Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offcanvas button does not work if it contains HTML tags. #33776

Closed
SamThilmany opened this issue Apr 27, 2021 · 1 comment
Closed

Offcanvas button does not work if it contains HTML tags. #33776

SamThilmany opened this issue Apr 27, 2021 · 1 comment

Comments

@SamThilmany
Copy link

SamThilmany commented Apr 27, 2021

  • Operating system and version: macOS 10.15.7
  • Browser and version: Safari 14.0.3
  • A reduced test case

The new offcanvas component is triggered by a link with the href attribute or a button with the data-bs-target attribute. However, if the link/button contains other HTML tags, e.g. an icon like <span class="navbar-toggler-icon"></span> chances are, that the user ends up clicking on the icon. If he does so, the offcanvas will not be triggered. It only works if the border of the link/button is clicked, i.e. outside of the included HTML tag. I suppose that the responsible JS function uses the event.target instead of event.currentTarget but I'm not sure about this.

Have a look at the attached reduced test case to see this bug in action.

@alpadev
Copy link
Contributor

alpadev commented Apr 27, 2021

Fixed by #33545
Duplicate of #33614 #33654 #33477 #33457

@alpadev alpadev closed this as completed Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants