-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add overflow: hidden
and user-modify: none
to inert style
#33
base: main
Are you sure you want to change the base?
Conversation
@robdodson @valdrinkoshi PTAL? |
LGTM. @valdrinkoshi wdyt? |
@@ -633,6 +633,8 @@ function addInertStyle(node) { | |||
" -webkit-user-select: none;\n" + | |||
" -moz-user-select: none;\n" + | |||
" -ms-user-select: none;\n" + | |||
" overflow: hidden !important;\n" + | |||
" user-modify: none !important;\n" + |
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.
none
is not a valid type for user-modify
https://www.w3.org/TR/1999/WD-css3-userint-19990916#user-modify
Also, it should have the -moz
& -webkit
prefix https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-modify
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.
Ah, thanks! Changed to read-only
and added -moz
and -webkit
versions.
@@ -633,6 +633,8 @@ function addInertStyle(node) { | |||
" -webkit-user-select: none;\n" + | |||
" -moz-user-select: none;\n" + | |||
" -ms-user-select: none;\n" + | |||
" overflow: hidden !important;\n" + |
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.
This forces a repaint; currently we have other css properties that are causing a repaint as well (see #21), but those are bugs on the browsers.
Also, on windows this will cause a scrollbar to disappear/appear, causing resizing of the content (change the layout of the content/text), and loose the scroll position.
I'm not sure on this one, @robdodson @alice WDYT?
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.
It does cause a repaint, but only once per inert root, rather than once per element inside the inert root.
The Windows issue is trickier, though. It seems like there's no good solution here currently.
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.
Possible horrible idea that might not work...
Since you only need the overflow rule for Firefox, could you tuck it into a @supports
block to limit the damage?
@supports (--moz-user-select: none) {
[inert], [inert] * {
overflow: hidden !important;
}
}
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.
Oh that doesn't help the Windows issue though :P
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.
So where are we on this? How much of a deal breaker is the scrollbar thing compared to leaving things focusable? Do we have any other options besides those two?
Fixes #31