Modal: return focus to trigger without scrolling? #15
tinymachine
started this conversation in
Ideas
Replies: 1 comment
-
Hey @tinymachine, thanks for looking so thoroughly at these components, really appreciate the time you're taking in helping to improve them 🙂 That's a nice use case you've found! And definitely some unwanted behavior. Your solution to this sounds like the logical way to go, thanks for looking into it! I'll create an issue and when I've got the time I will implement it 👍🏼 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @markteekman — right now when you close a Modal, focus returns to the trigger (which is great). But without the
preventScroll
option on thefocus()
method, the element scrolls fully into view if it's partially scrolled out of the viewport. I found this scrolling behavior unexpected. Just a thought that you might consider changing this line...accessible-astro-components/Modal.astro
Line 78 in 7ff14fe
to
(If I'm reading it correctly, caniuse.com reports that this option isn't supported on Safari 15.4, but it's working fine for me on macOS and iOS. 🤷🏾♂️)
Beta Was this translation helpful? Give feedback.
All reactions