-
Notifications
You must be signed in to change notification settings - Fork 8
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
Invalid item can still be saved #2
Comments
The problem to close this one is that there is no way to prevent save action. Directus actually enables the save button if any value is changed, so every interface need to emit new value as soon as the value is changed. I am thinking of two approaches to deal with that
|
I agree that option 1 may be the only solution. It should handle all possible way to delete the content of the input, i.e.:
Probably firing validation on keystroke (like I suppose it is working now) it's not the best way to handle this scenarios, maybe a listener on value change is a better option. |
I think the points are covered now. I also added a reset initial value on blur when invalid. Just preventing saving is not possible with current Directus and the interface itself. I am thinking of another approach because in the 9.8 there is validation setup, which validation rules also support regex patterns, so rules could be parsed and used instead. |
@enzolupia did you checked it? |
Expected Behavior
Invalid fields prevent item from being saved.
Current Behavior
Invalid field still allow item to be saved .
Screen.Recording.2022-02-24.at.15.17.35.mov
Apparently, if the field is marked as valid at least once, directus will allows to save the item even if it not valid anymore.
Steps to Reproduce
The text was updated successfully, but these errors were encountered: