Preselect Default Value Reset if No Default Detected on Form
OffshoreIT Naveen
Currently, when a default value (true) is specified in the options list, the form correctly preselects the corresponding value. However, if the next options list does not contain any true value, the previously preselected item is not cleared, as no new default is detected.
This behavior can lead to incorrect or outdated selections persisting in the field.
Requested Enhancement:
Introduce a feature where, if all options in a dropdown list have their default value set to false, the preselected item is automatically reset. This ensures that the dropdown accurately reflects the updated options and avoids retaining outdated selections.
This functionality would improve form usability and accuracy, especially when switching between dynamic or conditional option lists.
Example:
1st Options Context:
options:[
{
default:true
id:"xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx"
label:"group1"
}
{
default:false
id:"xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx"
label:"group2"
}
]
Result: Preselects group1 (expected).
2nd Options Context:
options:[
{
default:false
id:"xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx"
label:"group1"
}
{
default:false
id:"xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx"
label:"group2"
}
]
Current Behavior: Dropdown still preselects group1 (previous value/incorrect).
Expected Behavior:
In the 2nd options context, the dropdown should reset to null (no selection) when no option has default: true.
Log In