-
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
[VisuallyHidden] Reintroduce VisuallyHidden top position #5208
Conversation
size-limit report
|
What are the a11y gains of removing top:0 ? I'm good to ship this fix and creating a follow up issue to remove the deprecated Sheet component. Do you know which is the new component that we will use instead of the Sheet? |
Ideally there would be a way to prevent developers from creating markup using |
@alex-page a couple of question re: merge & release:
|
* reintroduce VisuallyHidden top position * add docs * add comment
WHY are these changes introduced?
top:0
was removed fromVisuallyHidden
in Polaris v7.4.0. Unfortunately, this change does not play well with Sheets using Popovers.Prior to the
top:0
change, when aSheet
was opened, the underlying content would not scroll. After thetop:0
was removed, theVisuallyHidden
elements, presumably by nature of them beingposition: absolute
and outside the underlying page DOM flow, stretch the height of the underlying page when data-scroll-lock sets the body height to100%
. This causes the underlying page to scroll, which introduces strange Popover behaviour.In https://github.com/Shopify/online-store-web, there are 2 impacted
Sheet
components. The first, we were able to solve by reordering the markup. The 2nd is harder - there are a lot ofVisuallyHidden
elements on the underlying page, and overriding the CSS of each element would be a lot of hacky code.Sheet
is deprecated, but until we have UX/dev resources to move away from the pattern, it would be really helpful to reintroducetop:0
.Before:
Screen.Recording.2022-02-17.at.17.43.43.mov
After:
(running fix on v8 Polaris)
Screen.Recording.2022-02-23.at.11.27.06.mov
Deployment 🌶️
If possible, it would amazing to cut a v8 hotfix with this change. Please let me know your thoughts 🙏
Other approaches considered
We could keep the a11y gains of removing
top:0
, and see if there's an adjustment to be made inSheet
. However, I don't know if it's worth sinking the time into a deprecated component. Again, would love to hear people's thoughts 🙏How to 🎩
Online Store
>Themes
Add Theme
>Connect to GitHub
Sheet
opens, the underlying page should not scroll.🎩 checklist