-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: detect dragging only by the delta changes #853
fix: detect dragging only by the delta changes #853
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/state/reducers/interactions.ts
Outdated
const dragging = !!( | ||
state.pointer.down && getDelta(state.pointer.down.position, action.position) > DRAG_DETECTION_PIXEL_DELTA | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
const dragging = !!( | |
state.pointer.down && getDelta(state.pointer.down.position, action.position) > DRAG_DETECTION_PIXEL_DELTA | |
); | |
const dragging = !!state.pointer.down && getDelta(state.pointer.down.position, action.position) > DRAG_DETECTION_PIXEL_DELTA; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in f182f94
🎉 This PR is included in version 23.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 23.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [23.2.1](elastic/elastic-charts@v23.2.0...v23.2.1) (2020-10-06) ### Bug Fixes * detect dragging only by the delta changes ([opensearch-project#853](elastic/elastic-charts#853)) ([7bf48bf](elastic/elastic-charts@7bf48bf)) * filter highlighted y values ([opensearch-project#855](elastic/elastic-charts#855)) ([1e99ccd](elastic/elastic-charts@1e99ccd))
Summary
This fix changes the drag detection checking only the delta change between the mouse down position and the current mouse move removing the time check. This allows fast interaction used in CI functional tests without the need to add a delay between actions.