-
Notifications
You must be signed in to change notification settings - Fork 842
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
EuiRange - onValidatedChange props #1461
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.
Thanks for adding this, I just saw a couple of issues and had a couple of suggestions.
Also, could you do one more change to support decimals in the sizing of the attached input by changing that line to:
const maxWidthStyle = { maxWidth: `${Math.max(String(min + step).length, String(max + step).length) + 2}em` };
src/components/form/range/range.js
Outdated
{this.renderLabel('max')} | ||
{extraInputNode} | ||
</div> | ||
{this.renderErrorMessage()} |
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 think we should leave out rendering the error message in the DOM because this should technically be handled by a EuiFormRow
that hooks up the message to the input. Currently this error message does not get read by a screen reader as it is.
Maybe it should just pass back an error message then the consumer can hook it into the error
prop of EuiFormRow
?
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.
Ok. I will add a onValidationError
callback that receives the error message
@cchaos I am not sure I like having separate callbacks |
I think that's fine. That'll also help with localization. |
closing. EuRange refactor has made these changes obsolete |
fixes #1458
Adds prop
onValidatedChange
toEuiRange
.onValidatedChange
is only called when value changes to a Number that is within the provided min and max (inclusive).