Closed pradeepnschrodinger closed 4 months ago
This fixes the issue seen at #723. The onmousedown handler for Scrollbar throws an error when the user tries to scroll at the beginning of the scroll content area, which happens because targetTouches is undefined at: https://github.com/schrodinger/fixed-data-table-2/blob/522e82be907c41c250b231a76e3127abed9aed81/src/plugins/Scrollbar.js#L527-L537 because we're actually doing a normal mouse click instead of a "touch" click. But the code shouldn't have reached here in the first place.
onmousedown
targetTouches
undefined
The root problem is that FDT thinks it's a touch event because of the way we use the || operator in https://github.com/schrodinger/fixed-data-table-2/blob/522e82be907c41c250b231a76e3127abed9aed81/src/plugins/Scrollbar.js#L358-L364 We should instead use the ?? operator for cases like this.
||
??
Fixes #723
Tested on local examples
@karry08 , friendly ping
lgtm
Released with v2.0.12.
Description
This fixes the issue seen at #723. The
onmousedown
handler for Scrollbar throws an error when the user tries to scroll at the beginning of the scroll content area, which happens becausetargetTouches
isundefined
at: https://github.com/schrodinger/fixed-data-table-2/blob/522e82be907c41c250b231a76e3127abed9aed81/src/plugins/Scrollbar.js#L527-L537 because we're actually doing a normal mouse click instead of a "touch" click. But the code shouldn't have reached here in the first place.The root problem is that FDT thinks it's a touch event because of the way we use the
||
operator in https://github.com/schrodinger/fixed-data-table-2/blob/522e82be907c41c250b231a76e3127abed9aed81/src/plugins/Scrollbar.js#L358-L364 We should instead use the??
operator for cases like this.Motivation and Context
Fixes #723
How Has This Been Tested?
Tested on local examples
Types of changes
Checklist: