Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#11665 closed defect (fixed)

ComboBox: pressing enter should submit the form

Reported by: dafoo Owned by: bill
Priority: high Milestone: 1.6
Component: Dijit - Form Version: 1.5
Keywords: Cc: Douglas Hays
Blocked By: Blocking:

Description (last modified by bill)

When...

  1. The Cursor is in a ComboBox/FilteringSelect
  2. the result-list is not open

... then the form should be submitted, the widget is in.

Attachments (1)

enter.patch (13.8 KB) - added by bill 9 years ago.
patch without fix for FilteringSelect race condition

Download all attachments as: .zip

Change History (6)

comment:1 Changed 9 years ago by bill

Component: GeneralDijit
Description: modified (diff)
Milestone: tbd1.6
Owner: changed from anonymous to bill
Status: newassigned
Summary: [Dijit - ComboBox/FilteringSelect] pressing enter should submit the formComboBox: pressing enter should submit the form

Also TimeTextBox has the opposite problem, that the form will submit even when the drop down is open.

comment:2 Changed 9 years ago by bill

Cc: Douglas Hays added

There's a complication from this change: not to ComboBox, but to it's sister widget FilteringSelect.

FilteringSelect allows direct input of it's value, in addition to picking an item from the drop down. In this case, if the user (for examples) enters "california", the FilteringSelect will query the data store to map "california" --> "CA". If the data store is client/server then this query is asynchronous.

The problem exasperated by this new ENTER-key-submit feature is that a form can be submitted while FilteringSelect is still waiting for a return value from this asynchronous query. It will happen when the user types "california<ENTER>".

This asynchronous fetch was always a theoretical problem, but usually by the time the user has navigated to and clicked the SUBMIT button the asynchronous query will already have finished.

So I think in the above case we need to either delay the form submission, or at a minimum cancel the submit if the FilteringSelect is still waiting for a query result. Since it's an uncommon case I don't mind just cancelling the submit. The user will just try again and it will work.

Changed 9 years ago by bill

Attachment: enter.patch added

patch without fix for FilteringSelect race condition

comment:3 Changed 9 years ago by bill

(In [22827]) fix spacing (prior to real changes), refs #11665

comment:4 Changed 9 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [22831]) Modify _HasDropDown so that ENTER key on an <input> based widget won't open/close the drop down (instead, we let the event bubble up, so it submits the form). Fixes to ComboBox so that ENTER submits the form when the drop down is closed. Fixes to TimeTextBox so that ENTER doesn't submit the form when the drop down is open.

Fixes #11665 !strict

comment:5 Changed 8 years ago by bill

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