Closed seanupton closed 9 years ago
@seanupton in javascript widget will submit dict with type attribute eg "{ "type": "date", ... }" which selects one of previous fields. invariant method is then not needed since front end can only select one
does this clarifies things a bit?
@garbas I suspected as much.
Ref commit: https://github.com/upiq/uu.task/commit/19a04532c3f2fc73b120538859480aa6c549285e
Once you have specified one of the three mutually exclusive choices, it is often impossible to modify without invariant raising Invalid.
Somehow we need some normalization to appropriately choose (in JavaScript, most likely) just one to submit. Ideally, any solution to this should preserve intent of user, allowing them to choose one or the other without clearing the mutually exclusive choices, but instead just hiding/ignoring until after submit/save.