appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.35k stars 3.72k forks source link

[Enhancement]: Indicate to the user as a nudge when default selected does not match with user options on select, radio, checkbox widgets #9243

Open ramsaptami opened 2 years ago

ramsaptami commented 2 years ago

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.

LOOM DEMO

somangshu commented 2 years ago

this is expected behaviour, I am closing this because its a non issue

aswathkk commented 2 years ago

Hey team! Please add your planning poker estimate with ZenHub @riodeuno @hetunandu

riodeuno commented 2 years ago

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

aswathkk commented 2 years ago

@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.

jsartisan commented 2 years ago

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.

riodeuno commented 2 years ago

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.

shadabbuchh commented 1 year ago

Due to this issue some other validations don't work as expected: https://www.loom.com/share/5e4c82c312aa41ec822d90ecece941a1