ScrollArea: option to pin the vertical scrollbar to a physical side in RTL #9036
ReemX
started this conversation in
Feature requests
Replies: 1 comment 1 reply
|
I'll check if it is possible and include as part of 9.5 release if it is |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi Mantine team, thanks for all the work on the library.
We build a set of Hebrew (RTL) apps on Mantine and keep hitting the same thing with
ScrollArea. In RTL the vertical scrollbar follows the inline-end edge, so it lands on the left. That's technically correct, but it goes against what RTL users here actually expect: Windows, Office, Gmail and most desktop software keep the vertical scrollbar on the right no matter the language, and our users read a left-side scrollbar as a bug.Today the only way to move it is overriding the CSS on
.mantine-ScrollArea-scrollbarwith!important. That shifts the track, but it desyncs from everything else —offsetScrollbarsstill reserves its gap withpadding-inline-end, so the gap ends up on the opposite side from the scrollbar, and it gets worse once a Modal is in play. We're maintaining a small pile of overrides that fight the component instead of configuring it.Would you be open to a prop that pins the vertical scrollbar to a physical side, independent of direction?
verticalScrollbarPosition?: 'left' | 'right', omitted by default so nothing changes for existing users.The nice part is it's almost entirely CSS. The vertical scrollbar's thumb math is already direction-independent — in the vertical branch the drag handler and
getThumbOffsetFromScrollare called withoutdirand work offscrollTop. So only two things are tied to direction on the vertical axis: the track side (inset-inline-end) and the offset gap (padding-inline-end). Both can key off adata-*attribute set from the prop, and the horizontal axis stays untouched, soscrollbars="xy"keeps working.Happy to open a PR with the prop, a test and the docs entry if you'd accept it. Wanted to check the direction and the prop name first, per the contributing guide.
Thanks!
All reactions