#input validation in Phase Names preventing backspacing the last character
1 messages · Page 1 of 1 (latest)
This is intended behavior: The phase name is not allowed to be empty
oooh - because it's changing it in real-time, not using an intermediate state - gotcha.
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)
Good point: I actually made exactly this change to some other places in the UI a while ago...