Skip to content
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

Merged
merged 7 commits into from
Mar 10, 2020

Conversation

sorenlouv
Copy link
Member

@sorenlouv sorenlouv commented Mar 9, 2020

This PR adds string as a type for value in the EuiFieldNumber 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 called e.target.value will likewise be of type string 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:
image

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3020/

sorenlouv and others added 2 commits March 10, 2020 19:34
@sorenlouv
Copy link
Member Author

@dimitropoulos @thompsongl Done! :)

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3020/

Copy link
Contributor

@thompsongl thompsongl left a 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?

@sorenlouv
Copy link
Member Author

@thompsongl I added it as a bug fix. Not sure if that's the right classification. LMK if I should change it.

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3020/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants