Page MenuHomePhabricator

Values dependent on does not reset linked input value on change
Closed, DeclinedPublicBUG REPORT

Description

Steps to replicate the issue:

  • Create a form as below:
{{{for template|Page}}}
Country:
{{{field|Country|input type=dropdown|property=Country}}}
City:
{{{field|City|input type=combobox|values dependent on=Page[Country]|existing values only}}}
{{{end template}}}
  • Create a set of Page pages with Country and City fields filled with data
  • Try to create a new page via a form
  • Set Country to something
  • Set City to something
  • Change Country input value

What happens?:

  • The City combobox retains old value, not cleared

What should have happened instead?:

  • The City combobox should be cleared when Country input value is changed

Software version:

Event Timeline

To clarify - are you saying that the value of the second input should always be cleared, or only cleared if (as in your case) "existing values only" is set?

Yes, I think the dependent input should always be cleared

Change 984234 had a related patch set uploaded (by Techwizzie; author: Techwizzie):

[mediawiki/extensions/PageForms@master] Reset linked input value on change of the input which depends on it

https://gerrit.wikimedia.org/r/984234

Sorry, I should have responded to this before. It's not clear to me that this is actually a problem that should be fixed. Let's take an example case:

  • A user accidentally enters "Dominica" instead of "Dominican Republic" in a form's "Country" field.
  • They then enter "Santo Domingo" in the "City" field, even though that is not one of the dependent autocompletion options.
  • They then realize their mistake, and change the "Country" value to "Dominican Republic".
  • The "City" input then gets blanked, even though "Santo Domingo" ironically is one of the autocompletion choices.

I admit that this will probably not happen often. Even in the more usual case, though, when the second value entered needs to be changed, how much time does blanking the value save the user - 1 second? It seems like a very minimal improvement, especially when compared to the confusion it could cause.

I'm closing this, based on the above reasoning - I don't think this change is a good idea.