You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In event handlers such as ionInput or ionKnobMoveEnd on an ion-range, it can happen that the event.detail.value is NaN.
When specifying currentX in the onEnd function inside range.js, detail.currentX can be 0.
But, If it is 0, it tries to assign clientX to currentX by || even though it is a GestureDetail. However, in this case, clientX is undefined, which causes a NaN to occur later.
The problematic part of the code is attached as the image below.
The bug can be fixed if it is modified to pass 0 when detail.currentX is 0.
Expected Behavior
When detail.currentX is 0, the value should be passed as is.
Issue number: resolves#29792
---------
<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->
<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->
## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->
When the user drags the range knob (most easily reproduced in fullscreen
mode) and the gesture emits a current x position of `0`, the range
incorrectly emits a value of `NaN`.
## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->
- `ion-range` does not emit `NaN` and instead emits the correct range
value for the knob
## Does this introduce a breaking change?
- [ ] Yes
- [ ] No
<!--
If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->
## Other information
<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
Peek 2024-08-23 14-31.webm
Please refer to the attached video.
In event handlers such as ionInput or ionKnobMoveEnd on an ion-range, it can happen that the event.detail.value is NaN.
When specifying currentX in the onEnd function inside range.js, detail.currentX can be 0.
But, If it is 0, it tries to assign clientX to currentX by || even though it is a GestureDetail. However, in this case, clientX is undefined, which causes a NaN to occur later.
The problematic part of the code is attached as the image below.
The bug can be fixed if it is modified to pass 0 when detail.currentX is 0.
Expected Behavior
When detail.currentX is 0, the value should be passed as is.
Steps to Reproduce
Code Reproduction URL
https://github.com/dodo-Riley/ionic-range-test
Ionic Info
Ionic:
Ionic CLI : 7.2.0 (/home/toonsquare/.nvm/versions/node/v18.18.1/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 7.8.6
@angular-devkit/build-angular : 15.2.11
@angular-devkit/schematics : 15.2.11
@angular/cli : 15.2.11
@ionic/angular-toolkit : 11.0.1
Utility:
cordova-res : 0.15.4
native-run (update available: 2.0.1) : 2.0.0
System:
NodeJS : v18.18.1 (/home/toonsquare/.nvm/versions/node/v18.18.1/bin/node)
npm : 9.8.1
OS : Linux 6.5
Additional Information
No response
The text was updated successfully, but these errors were encountered: