Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Redesign: use native auto-hiding scrollbars in room sub lists #2264

Merged
merged 3 commits into from
Nov 2, 2018

Conversation

bwindels
Copy link
Contributor

@bwindels bwindels commented Nov 1, 2018

element-hq/element-web#7560

As gemini scrollbars cause lag while resizing and have some layout implications for the room lists distribution, I had a go at using native scrollbars. I just applied it to the room sub lists, but could be expanded to the whole app.

The idea is put it on experimental and have people play around with it to see if we like it.
Browser support is organized in 3 tiers:

  1. browser with auto-hiding, overlay scrollbars, nothing to do here but overflow: auto. This includes Edge with -ms-overflow-style: -ms-autohiding-scrollbar. (Safari, Edge, others depending on platform)
  2. fallback for Webkit with overflow: overlay. This does not auto-hide the scrollbars however, so need to only do that on hover. (Chrome anywhere).
  3. only show scrollbar on hover, and compensate for space they take by adjusting padding using css variables and calc. Adjusting the padding only needs to happen when the scrollbars are actually shown, so use overflow/underflow events to add/remove css classes so CSS is aware of overflow. These events are Firefox only, but we already have all the other supported browsers covered with the prior approaches.

shows scrollbar on hover when needed
has fallback to overflow: overlay
and fiddling with padding to make content not jump on hover.
@bwindels bwindels requested a review from a team November 2, 2018 08:36
@dbkr dbkr merged commit b07514d into experimental Nov 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants