@@ -33,8 +33,6 @@ const FACE_MARGIN_2 = FACE_MARGIN * 2;
33
33
const FACE_SIZE_MIN = 30 ;
34
34
const KEYBOARD_SCROLL_AMOUNT = 40 ;
35
35
36
- let _lastScrolledScrollbar = null ;
37
-
38
36
class Scrollbar extends React . PureComponent {
39
37
static propTypes = {
40
38
contentSize : PropTypes . number . isRequired ,
@@ -110,7 +108,7 @@ class Scrollbar extends React.PureComponent {
110
108
let faceStyle ;
111
109
const isHorizontal = this . state . isHorizontal ;
112
110
const isVertical = ! isHorizontal ;
113
- const isActive = this . state . focused || this . state . isDragging ;
111
+ const isActive = this . state . isDragging ;
114
112
const faceSize = this . state . faceSize ;
115
113
const isOpaque = this . props . isOpaque ;
116
114
const verticalTop = this . props . verticalTop || 0 ;
@@ -182,8 +180,6 @@ class Scrollbar extends React.PureComponent {
182
180
183
181
return (
184
182
< div
185
- onFocus = { this . _onFocus }
186
- onBlur = { this . _onBlur }
187
183
onKeyDown = { this . _onKeyDown }
188
184
onMouseDown = { this . _onMouseDown }
189
185
onTouchCancel = { this . _onTouchCancel }
@@ -244,9 +240,6 @@ class Scrollbar extends React.PureComponent {
244
240
this . _mouseMoveTracker . releaseMouseMoves ( ) ;
245
241
this . _mouseMoveTracker = null ;
246
242
}
247
- if ( _lastScrolledScrollbar === this ) {
248
- _lastScrolledScrollbar = null ;
249
- }
250
243
}
251
244
252
245
scrollBy = ( /*number*/ delta ) => {
@@ -313,15 +306,10 @@ class Scrollbar extends React.PureComponent {
313
306
position = maxPosition ;
314
307
}
315
308
316
- const isDragging = this . _mouseMoveTracker
317
- ? this . _mouseMoveTracker . isDragging ( )
318
- : false ;
319
-
320
309
// This function should only return flat values that can be compared quiclky
321
310
// by `ReactComponentWithPureRenderMixin`.
322
311
const state = {
323
312
faceSize,
324
- isDragging,
325
313
isHorizontal,
326
314
position,
327
315
scale,
@@ -358,6 +346,8 @@ class Scrollbar extends React.PureComponent {
358
346
} ;
359
347
360
348
_onMouseDown = ( /*object*/ event ) => {
349
+ this . setState ( { isDragging : true } ) ;
350
+
361
351
/** @type {object } */
362
352
let nextState ;
363
353
@@ -387,7 +377,6 @@ class Scrollbar extends React.PureComponent {
387
377
nextState = { } ;
388
378
}
389
379
390
- nextState . focused = true ;
391
380
this . _setNextState ( nextState ) ;
392
381
393
382
this . _mouseMoveTracker . captureMouseMoves ( event ) ;
@@ -535,32 +524,6 @@ class Scrollbar extends React.PureComponent {
535
524
) ;
536
525
} ;
537
526
538
- _onFocus = ( ) => {
539
- this . setState ( {
540
- focused : true ,
541
- } ) ;
542
- } ;
543
-
544
- _onBlur = ( ) => {
545
- this . setState ( {
546
- focused : false ,
547
- } ) ;
548
- } ;
549
-
550
- _blur = ( ) => {
551
- const el = ReactDOM . findDOMNode ( this ) ;
552
- if ( ! el ) {
553
- return ;
554
- }
555
-
556
- try {
557
- this . _onBlur ( ) ;
558
- el . blur ( ) ;
559
- } catch ( oops ) {
560
- // pass
561
- }
562
- } ;
563
-
564
527
getTouchX = ( /*object*/ e ) => {
565
528
return Math . round (
566
529
e . targetTouches [ 0 ] . clientX - e . target . getBoundingClientRect ( ) . x
@@ -593,11 +556,6 @@ class Scrollbar extends React.PureComponent {
593
556
}
594
557
return ;
595
558
}
596
-
597
- if ( willScroll && _lastScrolledScrollbar !== this ) {
598
- _lastScrolledScrollbar && _lastScrolledScrollbar . _blur ( ) ;
599
- _lastScrolledScrollbar = this ;
600
- }
601
559
} ;
602
560
603
561
_didScroll = ( ) => {
0 commit comments