This repository has been archived by the owner on Sep 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 271
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 :) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: