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

For modal use :target instead of :focus #2

Closed
dominikwilkowski opened this issue Oct 9, 2016 · 5 comments
Closed

For modal use :target instead of :focus #2

dominikwilkowski opened this issue Oct 9, 2016 · 5 comments

Comments

@dominikwilkowski
Copy link

dominikwilkowski commented Oct 9, 2016

Hi Una,

Love this effort. Thanks for putting some work into this.
My suggestion for the modal is to use :target instead of :focus as it also moves the focus to the open modal (important for a11y) and is arguably more stable.
A trick here is to use the close button to target the original open button as well so focus is also returned to the original element.
Happy to do a PR if you're interested.

Cheers

@r3nya
Copy link

r3nya commented Oct 12, 2016

Hi @una and @dominikwilkowski!

I totally agree with @dominikwilkowski.
Btw, I made a simple example for you http://codepen.io/r3nya/pen/pEKzyK
Please look.

PS: Thanks for you idea. I love it. ❤️

@Haroenv
Copy link
Contributor

Haroenv commented Oct 12, 2016

related to #10, the version by @r3nya does work on Safari.

@r3nya
Copy link

r3nya commented Oct 12, 2016

Hey @Haroenv!
It works on Safari 10 (macOS).

@Haroenv
Copy link
Contributor

Haroenv commented Oct 12, 2016

Yep, that's what I was saying. The version you posted does work, while the one on the site doesn't yet.

@r3nya
Copy link

r3nya commented Oct 12, 2016

@Haroenv oops, sorry …

marcysutton pushed a commit to marcysutton/YouMightNotNeedJS that referenced this issue Oct 13, 2016
marcysutton pushed a commit to marcysutton/YouMightNotNeedJS that referenced this issue Oct 13, 2016
marcysutton pushed a commit to marcysutton/YouMightNotNeedJS that referenced this issue Oct 19, 2016
@una una closed this as completed in 26c4358 Nov 17, 2016
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

3 participants