#input validation in Phase Names preventing backspacing the last character

1 messages · Page 1 of 1 (latest)

tulip breach
#

can't backspace the last remaining character of the default name in a new phase

dim vapor
#

This is intended behavior: The phase name is not allowed to be empty

tulip breach
#

oooh - because it's changing it in real-time, not using an intermediate state - gotcha.

tulip breach
#

a thought occurs here that might be a better pattern in other places too,
(I'm assuming that slate handlerse are similar to what's in the JS API)

change the handler to be onTextCommited instead of onTextChanged.
do the validation check during that handler and if it's empty, revert it

#

(I just encountered this problem on a React project and said "oh, same shape" figured I'd share how I got around it)

dim vapor
#

Good point: I actually made exactly this change to some other places in the UI a while ago...