Closed mwcraig closed 6 months ago
Note to self: Turns out this is the default behavior in ipyautoui. The save and revert buttons are always enabled, regardless of the validation state and whether changes have been made.
Rather than making a fix in custom_widgets.py
I think it is better to make the change in ui_generator
in views.py
so that all of the ipyautoui
forms have the same behavior.
This sequence of events leads to an save button that is enabled even though no changes have been made:
The root cause is these lines which are an attempt to make to prevent the save button dfrom being enabled unless the model is valid.
That is useful, but whether there are any unsaved changes also needs to be taken into account. That is available in
SaveButtonBar.unsaved_changes
.