Skip to content

Conversation

VeraZab
Copy link
Contributor

@VeraZab VeraZab commented Jan 9, 2019

closes: #822

screen shot 2019-01-09 at 11 15 41 am

same style as in this pr:
#811 (comment)

@VeraZab
Copy link
Contributor Author

VeraZab commented Jan 9, 2019

Because NumericInput is the base widget used in all numerics (DualNumeric, derived components) adding validation to it should be working for anywhere there's numerics involved.

@dmt0 @nicolaskruchten ready for review


this.state = {value: props.value};
this.state = {
value: props.value,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is not a new code addition, but assigning props to state is such an antipattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's our way of not having plotly.js reject the value and override with its default

@nicolaskruchten
Copy link
Contributor

On my screen the little gray fuzzy focus style hides the red...

image

@VeraZab
Copy link
Contributor Author

VeraZab commented Jan 9, 2019

focussed version:
screen shot 2019-01-09 at 2 17 31 pm

@VeraZab
Copy link
Contributor Author

VeraZab commented Jan 9, 2019 via email

@nicolaskruchten
Copy link
Contributor

same comments as the other validation one: there's no easy "back out to defaults" mode... once it's red it stays red and deleting it doesn't undo... Can we have it accept "" such that plotly.js will then go back to defaults?

@VeraZab
Copy link
Contributor Author

VeraZab commented Jan 10, 2019

2019-01-09 20 35 16

@nicolaskruchten
Copy link
Contributor

💃

@VeraZab VeraZab merged commit 6eaca48 into master Jan 10, 2019
@VeraZab VeraZab deleted the numerics-error branch January 10, 2019 02:36
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.

Validate Numerics
3 participants