-
Notifications
You must be signed in to change notification settings - Fork 229
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
Adding Inline-SVG to close Button doesn't work. #268
Comments
There will be probably some issue with event target handling. Adding [data-micromodal-close] on svg element could help a bit. |
It's not just inline-svg; any child element has this effect for me. |
@b3u Yeah. |
if you click on the icon in the button and nothing happens, then add css property 'pointer-events: none' for this one. |
@vadholovin Just wondering, how is it working for you with |
@alljamin |
@alesvojta May be I am missing something but if you are restricting any type of interaction on any element inside the button, then you cannot open the modal until you trigger the close with |
@alljamin Well, you are right by saying that it restricts any type of interaction on any element inside the button. But the button itself and only itself should trigger the event, the point is that the elements inside have different |
That interferes with event bubbling. Alternatively you can use onClick (event) {
if (event.target.closest('[' + this.config.closeTrigger + ']')) {
this.closeModal(event)
}
} using |
I am not happy with the solutions. Anyone has an idea for a better solution maybe with JQuery if it has to be used? |
Should be fixed with #443. Feel free to open, if the issue persists. |
While using something like tailwindcss, inline SVG's are a way to go. But using an inline SVG in a close button, you can't click on the SVG. No strange Styling applied. The "word" close is working.
The text was updated successfully, but these errors were encountered: