-
Notifications
You must be signed in to change notification settings - Fork 601
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
feat: add fast-number-field component for data applications #4204
Conversation
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.
In sites/website/sidebars.js
we need to add this component to the list. Very excited to get this in!
required: false, | ||
}, | ||
], | ||
slots: [ |
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.
There are start and end slots as well yes?
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.
Added start and end slots.
packages/web-components/fast-foundation/src/number-field/number-field.template.ts
Outdated
Show resolved
Hide resolved
?required="${x => x.required}" | ||
size="${x => x.size}" | ||
:value="${x => x.value}" | ||
type="text" |
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.
@robarbms Are there any potential implications with having this be articulated as text semantically and via AT but having it behave strictly as a number?
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.
I used text type rather than number to avoid limitations of number. You can not use float values unless your steps are set to a float value(not 1.0, it needs to be a fractional like 0.1). I do number validation on the component side rather than using the in built validation of type number.
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.
Thanks! Given that shift, I wonder if we should add support for inputmode
as an attribute here with only numeric types? Research on that here for input with type text for numbers similar to the choice we're making: https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/
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.
I've updated the inputmode. I left off pattern because I already had validation being handled on the valueChanged method using parseFloat. Their pattern seemed incomplete for data statistics and trying to maintain a pattern could be potentially problematic.
packages/web-components/fast-foundation/src/number-field/number-field.ts
Outdated
Show resolved
Hide resolved
…/robarb/number-field
…/robarb/number-field
…oft/fast into users/robarb/number-field
…/robarb/number-field
Description
Adds a fast-number-field component which takes numerical values that can be incremented and decremented in user defined stepped values.
Motivation & context
Provides a text entry for numerical values requested by community.
#3857
Issue type checklist
Is this a breaking change?
Adding or modifying component(s) in
@microsoft/fast-components
checklistProcess & policy checklist