-
Notifications
You must be signed in to change notification settings - Fork 461
[NumberField] Unsigned integer values and fixes #3373
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
vnbaaij
merged 12 commits into
microsoft:dev
from
PascalVorwerk:users/pcwvorwerk/fix-issue-2882
Feb 18, 2025
Merged
[NumberField] Unsigned integer values and fixes #3373
vnbaaij
merged 12 commits into
microsoft:dev
from
PascalVorwerk:users/pcwvorwerk/fix-issue-2882
Feb 18, 2025
Conversation
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
… into users/pcwvorwerk/fix-issue-2882
Collaborator
Author
|
Im sorry i am not sure why the commits of my previous pull request are included as commits... Can i somehow undo that? Or is it not a problem? |
dvoituron
requested changes
Feb 16, 2025
…ault parameters on Min/Max.
Contributor
|
Another issue with default fluent-number-field:has([min]) {
border: 1px solid red;
}
|
dvoituron
previously requested changes
Feb 17, 2025
.../Core/NumberField/FluentNumberFieldTests.FluentNumberField_AdditionalParameter.verified.html
Show resolved
Hide resolved
vnbaaij
requested changes
Feb 17, 2025
…t clearing error messages
vnbaaij
approved these changes
Feb 17, 2025
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.
Pull Request
📖 Description
I came across #2882 and thought this was an interesting proposal. In my own applications i have felt the need to set the minimum to 0 without allowing the user to go below it! Now to my supprise, the current implementation actually has some bugs (in my eyes):
This makes type safety not really a thing.. So my proposal would be to 'enforce' the minimum and maximum values of each type by using the min/max values of the type as a default parameter. @vnbaaij already made a nice helper method to get these minimum and maximum values for each type.
🎫 Issues
#2882
👩💻 Reviewer Notes
I've had to custom check for the unsigned integers and parse them separately because the BindConverter of AspNetCore does not implement extension methods for these types. I could not extend the BindConvert because for some reason it gave me a sealed error, so i am manually checking for the types, after first trying it with the BindConvert. Let me know if you guys think this is a wrong approach!
📑 Test Plan
I have added some tests and examples to the projects. The tests validate the new Min/max parameters. I've had to regenerate the verified files because now each fluent-number-input component will always have a min/max by default generated.
✅ Checklist
General