Skip to content

Commit 8095931

Browse files
committed
Completely disable horizontal scroll track for ReactCustomScrollbars
The invisible scroll tracks were intercepting mouse events.
1 parent a0d5e11 commit 8095931

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/client/src/components/Scrollbar/Scrollbar.sss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
height: 100%
1515
width: 100%
1616

17-
.track
17+
.htrack
18+
display: none
19+
20+
.vtrack
1821
$w: 8px
1922
border-radius: calc($w / 2)
2023
bottom: 2px

packages/client/src/components/Scrollbar/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ const getFaderStyle = (type, bgColor, top) => ({
2323
: OPACITY_FULL,
2424
})
2525

26-
const Track = ({ style }) => <div className={css.track} style={style} />
26+
const VTrack = ({ style }) => <div className={css.vtrack} style={style} />
2727

28-
Track.propTypes = {
28+
VTrack.propTypes = {
2929
style: PropTypes.shape({
3030
opacity: PropTypes.number.isRequired,
3131
position: PropTypes.string.isRequired,
@@ -34,6 +34,8 @@ Track.propTypes = {
3434
}).isRequired,
3535
}
3636

37+
const HTrack = () => <div className={css.htrack} />
38+
3739
const Scrollbar = ({ bgColor, children }) => {
3840
const scrollbar = useRef()
3941
const [top, setTop] = useState(0.0)
@@ -44,7 +46,8 @@ const Scrollbar = ({ bgColor, children }) => {
4446
autoHide
4547
onScrollFrame={({ top: newTop }) => setTop(newTop)}
4648
ref={scrollbar}
47-
renderTrackVertical={Track}
49+
renderTrackHorizontal={HTrack}
50+
renderTrackVertical={VTrack}
4851
>
4952
{children}
5053
</ReactCustomScrollbars>

0 commit comments

Comments
 (0)