Skip to content
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

If MicroModal.show on load => data-custom-close not working #350

Closed
Ezra-Siton-UIX opened this issue Jul 6, 2020 · 2 comments
Closed

If MicroModal.show on load => data-custom-close not working #350

Ezra-Siton-UIX opened this issue Jul 6, 2020 · 2 comments

Comments

@Ezra-Siton-UIX
Copy link

Demo:
https://codepen.io/ezra_siton/pen/vYLRYqO?editors=1100

Only if I close the modal (by ESC) - and open the modal again the close button works fine.

Maybe related:
#187

@chris-lawton
Copy link

It's this - #385

If a user uses the show method they assume that it will open the modal with the same config as they used to init the modal. This is not the case, all config settings from the original init are replaced when using the show method.

In your instance you need to add closeTrigger to MicroModal.show:

MicroModal.show('modal-1', {
    closeTrigger: 'data-custom-close',
});  

https://codepen.io/chrislawton/pen/yLVRzxL?editors=1000

@Ezra-Siton-UIX
Copy link
Author

Thanks! this solves the issue. Anyway, it is very hard for users to notice this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants