Skip to content

Conversation

@alice
Copy link
Member

@alice alice commented Oct 26, 2016

Fixes #31

@alice
Copy link
Member Author

alice commented Oct 26, 2016

@robdodson @valdrinkoshi PTAL?

@robdodson
Copy link
Collaborator

LGTM. @valdrinkoshi wdyt?

inert.js Outdated
" -moz-user-select: none;\n" +
" -ms-user-select: none;\n" +
" overflow: hidden !important;\n" +
" user-modify: none !important;\n" +
Copy link
Collaborator

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

Copy link
Member Author

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.

" -webkit-user-select: none;\n" +
" -moz-user-select: none;\n" +
" -ms-user-select: none;\n" +
" overflow: hidden !important;\n" +
Copy link
Collaborator

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?

Copy link
Member Author

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.

Copy link
Collaborator

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;
  }
}

Copy link
Collaborator

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

Copy link
Member Author

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?

@yoavweiss yoavweiss changed the base branch from master to main March 5, 2021 21:37
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

Successfully merging this pull request may close these issues.

3 participants