Closing alert will scroll to the selected button
See original GitHub issueHi When closing an alert, if the selected button is out of the screen, the scroll will automatically change to show the selected button. This can be replicated in the examples at GH pages by selecting one example, scrolling, and pressing enter.
This is particularly annoying, as I’m using sweetalert where the “activate” button is in a header with bootstrap “sticky-top” class, so when closing the modal it will always scroll to the top. This last problem is only present at Google Chrome.
I’m using a default sweetalert button:
swal({
titleText: "Test alert",
text: "This is a test alert"
});
Is there a way to fix this(or disable if it is a wanted feature)?
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (7 by maintainers)
Top Results From Across the Web
SweetAlert2 scrolls to initiating element after close
As you can see I'm trying to force the scroll to the top in multiple areas and this works, but then it snaps...
Read more >Window.scroll() - Web APIs - MDN Web Docs
The Window.scroll() method scrolls the window to a particular place in the document.
Read more >Alerts - Presentation - Human Interface Guidelines - Design
The default button can cancel the alert or perform the most likely nondestructive ... Although an alert might scroll if the text size...
Read more >ion-alert: Ionic API Alert Buttons with Custom Message Prompts
If a handler returns false then the alert will not automatically be dismissed when the button is clicked. All buttons will show up...
Read more >Scrollspy · Bootstrap v5.0
This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes,
.then()
is happening before the end of modal animation and before restoring the focus to the last active element.I agree about a bit of overhead, but it’s really just a bit of it:
Oh, well, fastest weekend of my life Thanks!