-
Notifications
You must be signed in to change notification settings - Fork 266
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
ViewModel autocommit is unreliable with required validator #1324
Comments
I cannot seem to reproduce this. In everything I tried when deleting the contents of the textfield the value of |
Weird... Full working example:
Steps to reproduce:
Hope its more clear now! |
So this does seem to be a bug, and it seems to be introduced by kotlin 1.4.0-rc. If you downgrade below that to 1.3.72 you will get what I assume is the intended behavior of the view modal value being null (which is also why I could not reproduce your problem initially): There is a WIP PR for tornadofx2 which upgrades to 1.4.32. The bug will need to be fixed there I suppose. |
Ok, thank you very much for the update :) |
When you setup a ViewModel property with autocommit == true and use the required validator on it it behaves weirdly. Lets suppose we setup a model like such:
When we erase the value from the textinput, the validator prevents the value from being commited, but the model property updates (to 0.0). Then when we type 0 into the textfield, the model doesnt detect a change and doesnt commit the model. This means the expected commit of the person value to 0.0 is skipped.
The text was updated successfully, but these errors were encountered: