-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Frame] Skip to content target / ref #2080
Conversation
👋 Thanks for opening your first pull request. A contributor should give feedback soon. If you haven’t already, please check out the contributing guidelines. |
🎩 works great! I like that this was brought down to 1 prop. Changelog needs an update but apart from that ✅ . Ping me when the that is ready. Thank you for doing this! |
3c3bb3a
to
e96f360
Compare
This works but not in the way I would expect. A bit or weirdness is happening with passing the ref and using it as a ternary to render things. I’ll take a look at fixing it when I have some more time and I’ll ping you then. Thanks ! |
bc0a1b8
to
47a1865
Compare
@dleroux updated and added changes to readme and 🎩 the styleguide |
I tophatted this in chroma -> frame in mac os, firefox nightly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this! 🎩 and works great! 🐑 🇮🇹
47a1865
to
25f8974
Compare
🎉 Thanks for your contribution to Polaris React! |
WHY are these changes introduced?
I discovered a problem working on a project for experts.shopify.com.
We were planning on using a
<Toast />
component for some user feedback but the<Toast />
component relies on the<Frame />
component to function.The
<Frame />
component adds a skip to content link for a11y purposes that is not configurable and does not work the way we need it to work.We already have a skip to content link of our own that places the user past our main navigation to the top of the content area. When we add the frame component to the app we end up with 2 skip to content links (ours that does the thing we want and the one created by the frame that does not function correctly).
Making the skip to content link configurable will allow us to use the Polaris components that rely on the frame component while still providing an accessible skip to content link.
WHAT is this pull request doing?
Adds a new prop to the
<Frame />
component.We add a
RefObject
so that on click we can focus the providedRefObject
and focus the user in the correct place.[GIF] Skipping to the target element
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx
:🎩 checklist
README.md
with documentation changes