Should have a way to tell the picker to get its initial value from a DOM element of the page it's on
Bug #482235 reported by
Guilherme Salgado
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LAZR Javascript Library |
Fix Released
|
Undecided
|
Guilherme Salgado | ||
Launchpad itself |
Fix Released
|
Undecided
|
Guilherme Salgado |
Bug Description
Sometimes the picker is activated by clicking on a link besides a text entry, and in such cases I usually start typing some text in the entry but then I realize I don't know the exact name/id of the thing I'm looking for, so I click on 'Choose...' to search for that thing. When I do that, the picker pops up and I have to type everything again because the picker doesn't take its initial value from the text entry besides it.
If there was a way to tell the picker to take its initial value from a DOM element of the page it's on, this could easily be done with no extra effort from the callsites.
Related branches
lp:~salgado/lazr-js/bug-482235
Merged
into
lp:lazr-js
- Māris Fogels (community): Approve
- Björn Tillenius: Pending requested
-
Diff: 248 lines (+107/-18)3 files modifiedexamples/picker/index.html (+30/-12)
src-js/lazrjs/picker/picker.js (+41/-2)
src-js/lazrjs/picker/tests/picker.js (+36/-4)
lp:~salgado/launchpad/bug-482235
Merged
into
lp:launchpad
- Māris Fogels (community): Approve
- Canonical Launchpad Engineering: Pending requested
-
Diff: 270 lines (+87/-33)10 files modifiedMakefile (+0/-3)
lib/canonical/launchpad/javascript/bugs/bugtask-index.js (+6/-6)
lib/canonical/launchpad/javascript/code/codereview.js (+5/-7)
lib/canonical/launchpad/javascript/lp/picker.js (+11/-9)
lib/canonical/launchpad/javascript/registry/team.js (+2/-1)
lib/canonical/launchpad/windmill/testing/lpuser.py (+2/-0)
lib/canonical/widgets/popup.py (+1/-1)
lib/canonical/widgets/templates/vocabulary-picker.js.template (+4/-5)
lib/lp/registry/windmill/tests/test_person_picker.py (+55/-0)
versions.cfg (+1/-1)
Changed in lazr-js: | |
assignee: | nobody → Guilherme Salgado (salgado) |
status: | New → Triaged |
Changed in lazr-js: | |
status: | Triaged → In Progress |
Changed in lazr-js: | |
status: | In Progress → Fix Committed |
Changed in launchpad-foundations: | |
assignee: | nobody → Guilherme Salgado (salgado) |
status: | New → In Progress |
Changed in launchpad-foundations: | |
status: | In Progress → Fix Committed |
Changed in lazr-js: | |
status: | Fix Committed → Fix Released |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
My initial idea was to add an optional 'get_initial_ value_from' attribute to the Picker so that callsites would be able to specify the DOM element from where the Picker would get the initial value for the search input.
However, Maris didn't like that idea because he thinks that'd make lazr-js too tied to LP's implementation (as the DOM node would have to provide a 'value' attribute), so he suggested adding this to an Y.lp.Picker, to be used in LP instead of the raw Picker.