Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

twg_'s avatar
Level 6

Alpinejs @click not firing when a span/svg inside a button is clicked.

I'm running into an issue I haven't seen before.

I have multiple buttons that change content on the right-hand side of the page when clicked. Each button has a span and SVG element inside it. The alpine click method isn't fired when you click where the span or SVG is. If I click outside of those areas, it works just fine.

<button @click.stop="primaryNavToggle($event)" value="1">
  <span>Link Label</span>
  <svg>...</svg>
</button>
0 likes
1 reply

Please or to participate in this conversation.