adds validation for fields.#2550
Conversation
* renames RoomTooltip to be a generic Tooltip (which it is) * hooks it into Field to show validation results * adds onValidate to Field to let Field instances call an arbitrary validation function
| this.setState({ hsUrl }); | ||
| } | ||
|
|
||
| onHomeserverValidate = (value) => { |
There was a problem hiding this comment.
This is placeholder to show how it's meant to be used.
jryans
left a comment
There was a problem hiding this comment.
Looks great overall, just added a few questions.
Would be nice to have a screenshot in the future as well. 😁
| .mx_Field_valid input, | ||
| .mx_Field_valid select, | ||
| .mx_Field_valid textarea { | ||
| border-color: $input-valid-border-color ! important; |
There was a problem hiding this comment.
What triggered all the important? Would adding an extra selector like .mx_Field.mx_Field_valid avoid the need for it?
There was a problem hiding this comment.
it's so that the valid/invalid state clobbers the focus-selected colour. i can't remember the specificity of :focus, hence clobbering with !important, which i agree is ugly. someone with more css-fu would be welcome to switch the selectors to be more elegant ;)
|
@jryans can i hand this over to you to either tweak & land, or land and tweak & use? |
Sure, works for me! |
* renames RoomTooltip to be a generic Tooltip (which it is) * hooks it into Field to show validation results * adds onValidate to Field to let Field instances call an arbitrary validation function Rebased from @ara4n's matrix-org#2550 by @jryans. Subsequent commits revise and adapt this work.
This is example code from @ara4n's work in matrix-org#2550. We're not ready to actually apply validation yet, so removing this for now.
|
I have rebased and extended this work in #2780, so the story continues over there. |
Uh oh!
There was an error while loading. Please reload this page.