patternfly-react
patternfly-react copied to clipboard
Number input - add new Status variant
Add a new variant of the Number input component to support inserting a status icon into the field (potentially used to warn users about exceeding threshold limits, etc).
Core PR: https://github.com/patternfly/patternfly/pull/4983
Should the new Status variant be based on the value of the number input? For example, it will only be success or warning (I didn't see a danger rendered) if the number input exceeds or falls below a certain value. I assume that it would to flow with the user experience.
Following up with that, should we allow for the use of two statuses? For example, if it meets a certain number input, then the user gets the success status, but in other cases, it may be a warning status. Having two might become an issue in cases where having no status at all might not mean anything but that is up to discussion. Just some thoughts :D
@andyyvo while what you are saying makes sense, I wasn't expecting us to code in the logic that decides what Icon to display. I think we would provide the mechanism to pass an icon, but the logic of what icon to display and when would be left to the consumer. This is consistent with the way we've handled similar things, I think. @nicolethoen @tlabaj do you agree with that?
@mcarrano we could definitely do it as you describe, but we do have a precedent of showing the inputs with validation on some other examples. I am thinking specifically of the validated form example.
Yes, that's true. But in that case, who specifies the validation criteria? I guess this is a similar use case.
I would imagine it was arbitrarily chosen by the dev who built that example in the case of the form.
Edit: nevermind this - i just dug and found out that text input does the error differently than warning/success