Skip to content

Commit 50bcc89

Browse files
authored
fix: scrollbar style should has the highest priority (#236)
1 parent 8b46eec commit 50bcc89

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ScrollBar.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ const ScrollBar = React.forwardRef<ScrollBarRef, ScrollBarProps>((props, ref) =>
207207
const containerStyle: React.CSSProperties = {
208208
position: 'absolute',
209209
visibility: visible && canScroll ? null : 'hidden',
210-
...style,
211210
};
212211

213212
const thumbStyle: React.CSSProperties = {
@@ -216,7 +215,6 @@ const ScrollBar = React.forwardRef<ScrollBarRef, ScrollBarProps>((props, ref) =>
216215
borderRadius: 99,
217216
cursor: 'pointer',
218217
userSelect: 'none',
219-
...propsThumbStyle,
220218
};
221219

222220
if (horizontal) {
@@ -261,7 +259,7 @@ const ScrollBar = React.forwardRef<ScrollBarRef, ScrollBarProps>((props, ref) =>
261259
[`${scrollbarPrefixCls}-vertical`]: !horizontal,
262260
[`${scrollbarPrefixCls}-visible`]: visible,
263261
})}
264-
style={containerStyle}
262+
style={{ ...containerStyle, ...style }}
265263
onMouseDown={onContainerMouseDown}
266264
onMouseMove={delayHidden}
267265
>
@@ -270,7 +268,7 @@ const ScrollBar = React.forwardRef<ScrollBarRef, ScrollBarProps>((props, ref) =>
270268
className={classNames(`${scrollbarPrefixCls}-thumb`, {
271269
[`${scrollbarPrefixCls}-thumb-moving`]: dragging,
272270
})}
273-
style={thumbStyle}
271+
style={{ ...thumbStyle, ...propsThumbStyle }}
274272
onMouseDown={onThumbMouseDown}
275273
/>
276274
</div>

0 commit comments

Comments
 (0)