This is a bit of an edge case but happened to us and caused some confusion.
Summary: If you have a record or block with a single line string field presented as “Select input” you can get into a confusing state if you have a default value set but change the values of the options without updating the default value.
How to reproduce
- Create a model called
Select Input Model
- Add a new Single-line Text field called
Select Input
- Under Presentation, choose
Select Input
- Use the labels/values First/First & Second/Second (see first screenshot below)
- Set the default value to
First
and save the field - Edit the field, go to presentation and change the values from
First
/Second
toFIRST
/SECOND
and save the field (don’t change the default value!)
Actual behavior
In the Default value tab in the Edit field modal it looks like First
is the selected default value.
However, opening the default value drop down and selecting First
will indicate that this is a change by making the Save field button highlighted.
This confusion also extends to records created with the above Model. If you go to content editing for the model, create a new record and save it it will look like First
is selected.
However selecting First
from the drop down again changes the state to Published (unsaved changes)
indicating that there has been a change even though visibly it looks like the change was a no-op.
Expected behavior
-
I expect that when editing a Text field presented as Select Input, it should not be possible to save it with a default value that is not one of the available options. Changing the option values should require me to update the default value, or at the very least, clear the previously selected default value.
-
I expect that I should not be able to save a record with a text field presented as Select Input if it has a value that is not available as an option value.
-
I expect that when I look at a record that has a value that is no longer available as an option for the field it should look like an error. Something like:
Links to the item, model, or project in question?
The below links are to a test environment of a test project so feel free to create new items, change models etc. if necessary.
- Model: Loading...
- Record with a field value no longer available as an option value: Loading...