I have a snippet that looks like this:
<div data-item-url="..." data-action="click->delete#ask"> <span class="icon has-text-danger"> <i class="far fa-trash-alt"></i> </span> </div>
“ask” is obviously a handler in my controller and the i-tag is expanded into a fontawesome icon. If I click on the icon, my handler is called as I would expect. But the target of the event is not the div. It is some generated SVG of the icon.
I’m a bit confused, because I don’t connect any click events to the SVG. I would expect that the div is the target of the event. I found another answer which proposes to use currentTarget instead of target, but that one is null. When looking at the event via dev tools, I only see SVG elements, but not my div.
Am I missing something? I need to access data-item-url in my handler and I don’t see how to do that with the wrong event target.