@@ -177,21 +177,13 @@ export default class ScrollBar extends React.Component<ScrollBarProps, ScrollBar
177
177
return ptg * enableHeightRange ;
178
178
} ;
179
179
180
- // Not show scrollbar when height is large than scrollHeight
181
- showScroll = ( ) : boolean => {
182
- const { height, scrollHeight } = this . props ;
183
- return scrollHeight > height ;
184
- } ;
185
-
186
180
// ====================== Render =======================
187
181
render ( ) {
188
182
const { dragging, visible } = this . state ;
189
183
const { prefixCls, direction } = this . props ;
190
184
const spinHeight = this . getSpinHeight ( ) ;
191
185
const top = this . getTop ( ) ;
192
186
193
- const canScroll = this . showScroll ( ) ;
194
- const mergedVisible = canScroll && visible ;
195
187
const scrollBarDirection =
196
188
direction === 'rtl'
197
189
? {
@@ -204,16 +196,14 @@ export default class ScrollBar extends React.Component<ScrollBarProps, ScrollBar
204
196
return (
205
197
< div
206
198
ref = { this . scrollbarRef }
207
- className = { classNames ( `${ prefixCls } -scrollbar` , {
208
- [ `${ prefixCls } -scrollbar-show` ] : canScroll ,
209
- } ) }
199
+ className = { `${ prefixCls } -scrollbar` }
210
200
style = { {
211
201
width : 8 ,
212
202
top : 0 ,
213
203
bottom : 0 ,
214
204
...scrollBarDirection ,
215
205
position : 'absolute' ,
216
- display : mergedVisible ? null : 'none' ,
206
+ display : visible ? null : 'none' ,
217
207
} }
218
208
onMouseDown = { this . onContainerMouseDown }
219
209
onMouseMove = { this . delayHidden }
0 commit comments