Merge lp:~salgado/lazr-js/bug-474459 into lp:lazr-js

Proposed by Guilherme Salgado
Status: Merged
Merged at revision: not available
Proposed branch: lp:~salgado/lazr-js/bug-474459
Merge into: lp:lazr-js
Diff against target: 47 lines (+7/-15)
2 files modified
src-js/lazrjs/picker/picker.js (+0/-8)
src-js/lazrjs/picker/tests/picker.js (+7/-7)
To merge this branch: bzr merge lp:~salgado/lazr-js/bug-474459
Reviewer Review Type Date Requested Status
Māris Fogels (community) Approve
Review via email: mp+14758@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote :

This branch fixes bug 474459 by dropping the click-anywhere-in-the-overlay-to-focus-text-input feature from the picker.

Revision history for this message
Māris Fogels (mars) wrote :

Hi Salgado,

This looks good. Please change the call on line 35 from Node.query() to Node.one().

r=mars

Maris

review: Approve
lp:~salgado/lazr-js/bug-474459 updated
132. By Guilherme Salgado

merge from mainline

133. By Guilherme Salgado

replace a .query() with .one()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src-js/lazrjs/picker/picker.js'
2--- src-js/lazrjs/picker/picker.js 2009-11-13 01:44:48 +0000
3+++ src-js/lazrjs/picker/picker.js 2009-11-13 15:40:27 +0000
4@@ -469,14 +469,6 @@
5 'key', this._defaultSearchUserAction, this._search_input,
6 'down:13', this);
7
8- // Give the focus to the search input.
9- Y.on('focus', function (e) {
10- if (e.target !== this._search_input){
11- e.halt();
12- this._search_input.focus();
13- }
14- }, this.get(BOUNDING_BOX), this);
15-
16 // Focus search box when the widget is first displayed.
17 this.after('visibleChange', function (e) {
18 var change = e.details[0];
19
20=== modified file 'src-js/lazrjs/picker/tests/picker.js'
21--- src-js/lazrjs/picker/tests/picker.js 2009-11-13 01:44:19 +0000
22+++ src-js/lazrjs/picker/tests/picker.js 2009-11-13 15:40:27 +0000
23@@ -776,17 +776,17 @@
24 "There should be no next button.");
25 },
26
27- test_widget_focus_goes_to_search_input: function () {
28+ test_text_input_on_footer_can_be_focused: function () {
29 this.picker.render();
30-
31- var bb = this.picker.get('boundingBox');
32- var search_input = bb.query('.yui-picker-search');
33+ this.picker.set('footer_slot', Y.Node.create(
34+ '<input class="extra-input" name="extra_input" type="text" />'));
35+ var extra_input = this.picker.get('boundingBox').one('.extra-input');
36 var got_focus = false;
37- search_input.on('focus', function(e) {
38+ extra_input.on('focus', function(e) {
39 got_focus = true;
40 });
41- bb.focus();
42- Assert.isTrue(got_focus, "focus didn't go to the search input.");
43+ extra_input.focus();
44+ Assert.isTrue(got_focus, "focus didn't go to the extra input.");
45 },
46
47 test_overlay_progress_value: function () {

Subscribers

People subscribed via source and target branches