Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#6197 closed defect (fixed)

[patch][ccla]ComboBox does not load item, when selecting a value with the keyboard

Reported by: John Locke Owned by: wolfram
Priority: high Milestone: 1.1
Component: Dijit - Form Version: 1.1b1
Keywords: Cc: haysmark
Blocked By: Blocking:

Description

  1. Create a data store-backed ComboBox?.
  1. Select an item from the list by typing a value, then use the mouse to select an item in the list.
  1. Trigger a script, and attempt to get values from the store using code like the following:
var cb = dijit.byId('mycombobox');
var source = cb.store.getValue(cb.item, 'source');

Result: "source" is set to the value looked up in the data store associated with the selected item.

  1. Repeat the above, only this time in step 2 use the keyboard to select an item (use up/down arrows, enter, tab).

Result: cb.item evaluates to false, not able to access other data in the store item.

Tested on FF2/Linux, Dojo 1.1.0b3.

Attachments (2)

6197.patch (704 bytes) - added by Douglas Hays 11 years ago.
waiting on verification from wolfram that #4872 is not regresed by this patch (refreshed)
6197andResetFix.patch (943 bytes) - added by wolfram 11 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 years ago by John Locke

ok, so it may not be the keyboard selection causing the problem, so much as blurring the field.

When the field is selected and I click the button that triggers my script, ComboBox?.item is set. If I tab out of the field, ComboBox?.item gets cleared. I'd like to see this remain set after an item is selected...

FilteringSelect? has this same behavior.

comment:2 Changed 11 years ago by Douglas Hays

Cc: haysmark added
Milestone: 1.1
Owner: set to wolfram

This may be a regression from #4872. wolfram, can you check to see if moving

this.item = null; // #4872

from _onKeyPress() to the start of _startSearch() fixes both problems?

comment:3 Changed 11 years ago by John Locke

Hi,

The proposed fix works fine for me here. I moved the line above to line 529 in the current trunk, and no problems so far.

Thanks, John

comment:4 Changed 11 years ago by Adam Peller

Summary: ComboBox does not load item, when selecting a value with the keyboard[patch][ccla]ComboBox does not load item, when selecting a value with the keyboard

Changed 11 years ago by Douglas Hays

Attachment: 6197.patch added

waiting on verification from wolfram that #4872 is not regresed by this patch (refreshed)

comment:5 Changed 11 years ago by wolfram

looks good from my side. go ahead and commit it ... I added another fix, which reset the item properly when reset() is called, which was not the case until now. thx

Changed 11 years ago by wolfram

Attachment: 6197andResetFix.patch added

comment:6 Changed 11 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [13113]) Fixes #6197. Proxy commit for wolfram. Resets the item attribute only on new searches and reset() instead on every keystroke.

comment:7 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.