better native scrollbar width compensation for FF

instead of having to offset the padding of children of the
autohiding scrollbar container, which gets fiddly quickly,
add a new child to the scrollbar container that gets a negative
margin of the scrollbar width when needed
(on hover and overflowing when overlay is not supported).

This needs an extra DOM element, but as it doesn't do anything weird
layout-wise (like set position), it shouldn't affect styling at all.

It also makes the auto hide scrollbar workarounds completely transparent
to the rest of the code.
This commit is contained in:
Bruno Windels 2018-11-06 10:20:04 +01:00
parent 3c70c2b82f
commit c9dc273cb0
4 changed files with 16 additions and 25 deletions

View file

@ -112,7 +112,9 @@ export default class AutoHideScrollbar extends React.Component {
ref={this._collectContainerRef}
className={["mx_AutoHideScrollbar", this.props.className].join(" ")}
>
{ this.props.children }
<div className="mx_AutoHideScrollbar_offset">
{ this.props.children }
</div>
</div>);
}
}