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

Event does not trigger in child element(s) of buttons #2507

Closed
imc786 opened this issue Feb 12, 2024 · 2 comments
Closed

Event does not trigger in child element(s) of buttons #2507

imc786 opened this issue Feb 12, 2024 · 2 comments

Comments

@imc786
Copy link

imc786 commented Feb 12, 2024

Describe the Bug

When using a button, data-umami-event does not trigger on children elements inside the button. Using Tailwind's p-8 to provide a chunk of padding, and bg-slate-800 is to recognise the padded text:

<button href="#" data-umami-event="test">
  <span className="bg-slate-800 p-8">Test</span>
</button>

With the code above, when you click on the text/padding, the event does not trigger. If you click the button outside the padding, the event triggers.

<button href="#" data-umami-event="test">
  <span className="bg-slate-800 p-8" data-umami-event="test-inside">Test</span>
</button>

With the code above, if you set an additional event tag, clicking the text/padding will trigger that event (test-inside).

<Link href="#" data-umami-event="test">
  <span className="bg-slate-800 p-8">Test</span>
</Link>

The expected behaviour should be the same as for normal <a> or <Link> component, where clicking the text/padding triggers the test event. The issue is that when using an external component library such as Flowbite React, it creates the child span element without the ability to pass data-umami-event to the children, which causes the event to not fire.

Database

Umami Cloud

Relevant log output

No response

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@Maxime-J
Copy link
Contributor

Maxime-J commented Feb 14, 2024

It's a known bug #2471, already fixed in dev and that will most likely be fixed in the next release.

@imc786
Copy link
Author

imc786 commented Feb 14, 2024

Thank you, hadn't noticed the open issue!

@imc786 imc786 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2024
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