-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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(range): handle unsupported values for range min, max, and step #30070
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
core/src/utils/type-guards.ts
Outdated
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.
Can SafeNumber be defined by a fixed value or a fixed range of values,
For example,
0 and <0.00005
any input is number between 0 and 0.00005 to be defined and therefore handled as a "nullish value" and enable the rule to be applied if (!isSafeNumber(n)) return 0;
…min were set to undefined by setting max and min to their default values if you try to set them directly to undefined
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
@fudom Congrats on your first PR with Ionic! |
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.
Looks great 🙂
Co-authored-by: Brandy Smith <[email protected]>
Thank you for your PR! It was merged into main and will go out with the next release. |
Issue number: resolves #29667
What is the current behavior?
Currently, if min/max are set to undefined on
IonRange
(which is an accepted value), it breaks the DOM.What is the new behavior?
After these changes, if min/max are set to undefined or any unsupported value (such as infinity or a NaN), it will fall back to the default values for min and max (currently, 1 and 100 respectively).
Does this introduce a breaking change?
Other information