Fix scrollbar errors when offset is zero #724
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:fixed-data-table-2/src/plugins/Scrollbar.js
Lines 527 to 537 in 522e82b
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 infixed-data-table-2/src/plugins/Scrollbar.js
Lines 358 to 364 in 522e82b
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: