Open ramsaptami opened 2 years ago
this is expected behaviour, I am closing this because its a non issue
Hey team! Please add your planning poker estimate with ZenHub @riodeuno @hetunandu
We need to update the validations to use a FUNCTION validation type, which uses the current props to validate that the defaultValues are a subset of the options. This effects the following widgets: Radio, Select, Checkbox, Checkbox group, Tree Select, Multi-tree select, switch group
@riodeuno We had that kind of validation for CheckboxGroupWidget and we removed it on #8598 since it was creating some issues. The default value can also come through bindings which makes things complicated. Maybe @jsartisan can give some more information.
we removed it because we felt that validation is just overkill and was creating issues with refreshing the app. I won't suggest doing it because sometimes the options list comes from an API and the default value may not be in the list from API.
I believe this issue talks about a DX issue for an Appsmith developer developing an app. The reason I like this issue, is because
Having said that, I believe as @jsartisan and @aswathkk mentioned we have a technical hurdle here w.r.t dynamically bound options.
So, let's revisit this issue once we have an approach for a DX that has an impact on our users.
@ramsaptami I'm decreasing the priority of this issue for now.
Due to this issue some other validations don't work as expected: https://www.loom.com/share/5e4c82c312aa41ec822d90ecece941a1
Is there an existing issue for this?
Summary
Currently, Default Selected Value(s) field on Radio, Select, Checkbox, Checkbox group, Tree Select does not validate against user defined options. So incorrect default value simply clears any selection (see video). Instead, provide a nudge to the user on a mismatch between default value set. Also, provide an option to leave this field blank to accommodate flexible use (as is current behavior)
Why should this be worked on?
Gently nudging the user helps user experience in case they miss changing default text for any reason.