Confusing UI for select input when option values change

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

  1. Create a model called Select Input Model
  2. Add a new Single-line Text field called Select Input
  3. Under Presentation, choose Select Input
  4. Use the labels/values First/First & Second/Second (see first screenshot below)
  5. Set the default value to First and save the field
  6. Edit the field, go to presentation and change the values from First/Second to FIRST/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

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

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

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

@gabriel1, I agree, this is something that’s gotten me a few times too :frowning: It would be nice if the UI could check to make sure the default value passes validations before allowing you to save.

Can I convert this into a feature request for you?

Yes, I guess it’s in the gray area between bug and feature request, feel free to convert it! :slight_smile:

1 Like