-
Notifications
You must be signed in to change notification settings - Fork 841
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
[EuiFieldNumber] Add string
as valid value type
#3020
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_3020/ |
Co-Authored-By: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
@dimitropoulos @thompsongl Done! :) |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3020/ |
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, @sqren!
Can you please add a changelog entry for this?
@thompsongl I added it as a bug fix. Not sure if that's the right classification. LMK if I should change it. |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3020/ |
This PR adds
string
as a type forvalue
in theEuiFieldNumber
component.Reasoning
There's nothing wrong with supplying a serialized number (eg. "40") to an input field, since it'll be serialized anyway. When the
onChange
handler is callede.target.value
will likewise be of typestring
regardless what the input type was.This will remove the need for serializing/deserializing numbers when working with
EuiFieldNumber
Impact
This won't change much, other than removing an error in the console when supplying a string: