Merge lp:~alastair-b/tiqit/dropdown-fix into lp:tiqit
Status: | Needs review |
---|---|
Proposed branch: | lp:~alastair-b/tiqit/dropdown-fix |
Merge into: | lp:tiqit |
Diff against target: |
54 lines (+18/-0) 2 files modified
static/scripts/tiqit.js (+9/-0) static/scripts/view.js (+9/-0) |
To merge this branch: | bzr merge lp:~alastair-b/tiqit/dropdown-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sam Stoll | Pending | ||
Review via email: mp+299060@code.launchpad.net |
Commit message
Improve handling for listboxes to cope with a default value which is not on the list of permitted values (instead set the value to the first permitted value).
Description of the change
Currently, when an editor object is retrieved with a set of permitted values, there is no checking to see if the default value is in the list of permitted values. When an attempt is made to set the editor.value to an invalid value, it ends up set to "" instead.
This change is twofold:
1. update the editor object retrieval to set editor.value to the first valid value if an invalid default value is specified
2. update the resetting to default value code in view.js to check if the attempt to set the editor value to the default value failed, and if it did, then restore the known good value which was set up initially when the editor object was retrieved.
This fixes the issue where updating the severity of a bug results in an empty "feature" field instead of the first valid value.
Unmerged revisions
- 15. By Alastair Palmer <email address hidden>
-
Review markups: use editor.input.value rather than editor.value.
- 14. By Alastair Palmer <email address hidden>
-
Add handling for the case where the current value of a listbox is not a
permitted value. Instead of accepting the default behavior of the
object's value being set to "", check it and set it to the first known
good value instead.