fix(range): handle unsupported values for range min, max, and step#30070
Merged
ShaneK merged 9 commits intoionic-team:mainfrom Mar 7, 2025
Merged
fix(range): handle unsupported values for range min, max, and step#30070ShaneK merged 9 commits intoionic-team:mainfrom
ShaneK merged 9 commits intoionic-team:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Em-5455
reviewed
Feb 19, 2025
core/src/utils/type-guards.ts
Outdated
There was a problem hiding this comment.
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
thetaPC
reviewed
Mar 7, 2025
Contributor
|
@fudom Congrats on your first PR with Ionic! |
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Member
|
Thank you for your PR! It was merged into main and will go out with the next release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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