8000 Do not break if mouse moves to x=0 when using rangeslider by david-bezero · Pull Request #6780 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Do not break if mouse moves to x=0 when using rangeslider #6780

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

Merged
merged 3 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply suggestions from code review
  • Loading branch information
8000 archmoj authored Nov 10, 2023
commit 769158d5f22aafce9e1ad0b2c050640e8c9f08eb
2 changes: 1 addition & 1 deletion draftlogs/6780_fix.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Fix `Cannot read properties of undefined (reading '0')` when the mouse moves to x=0 while dragging a rangeslider [[#6780](https://github.com/plotly/plotly.js/pull/6780)]
- Fix `Cannot read properties of undefined (reading '0')` when the mouse moves to x=0 while dragging a rangeslider [[#6780](https://github.com/plotly/plotly.js/pull/6780)], with thanks to @david-bezero for the contribution!
4 changes: 2 additions & 2 deletions src/components/rangeslider/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ module.exports = function(gd) {
};

function eventX(event) {
if (typeof event.clientX === 'number') {
if(typeof event.clientX === 'number') {
return event.clientX;
}
if (event.touches && event.touches.length > 0) {
if(event.touches && event.touches.length > 0) {
return event.touches[0].clientX;
}
return 0;
Expand Down
0