-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
When modal is opening scrolls to the top of the page #124
Labels
Comments
If you manage the click with a custom function and are using a link with an href="#", maybe your link is causing this behaviour. You could prevent it on your click listener. Here is an example: var modalTrigger = document.querySelector('selector-of-your-link');
var modal = new tingle.modal({});
modalTrigger.addEventListener('click', function(ev) {
// this line invalidate the behaviour of the link
// that is causing scrolling to top
ev.preventDefault();
modal.setContent('<p>Hello!</p>');
modal.open();
}); Hope it helps. |
Same issue here, but on closing.
Simple fix — swap "scrollTo" and "top = null" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: