Closed DimaGashko closed 3 years ago
I can confirm this: had the same issue where the close button with an svg icon inside wouldn't close properly (occasionally it did work), thought I was tripping. Thanks for the workaround.
for eslint i put
if (event.target.closest(`[${ this.config.closeTrigger }]`)) {
seems to work as it should. thank you!
Fixed in #443. Thanks @HongPong for the PR
I've added an svg icon to the close button and realized that the button doesn't work anymore.
Reason: you use event delegation slightly incorrect (https://github.com/ghosh/Micromodal/blob/master/lib/src/index.js#L131).
Solution: replace
hasAttribute
withclosest
:Html:
p.s. For now I'm just going to use something like:
It's working, but I hope you would fix it.
Details: https://javascript.info/event-delegation