and click onto the element, i.e. span, instead of the button the event handler wouldn't find the target, because the span doesn't have a data-a11y-toggle attribute.
So, I suggest adding sth. like this:
// try the parent
if (!target) {
var toggle = toggle.parentNode;
var target = targetsMap[toggle.getAttribute(namespace)];
}
Hey there. This issue has been reported as part of #7. Unfortunately, this toggle.parentNode solution would not work for deeply nested elements. I’ll issue a robust fix though. :)
Hi!
I noticed that, when you put an element inside of the toggle:
and click onto the element, i.e.
span
, instead of thebutton
the event handler wouldn't find the target, because thespan
doesn't have adata-a11y-toggle
attribute.So, I suggest adding sth. like this: