Skip to main content

Search and Top Navigation

#5343 closed bug (fixed)

Opened March 15, 2010 01:03PM UTC

Closed March 20, 2010 08:26PM UTC

Last modified April 21, 2010 01:17PM UTC

Add option to allow form submission when option is chosen

Reported by: nigel Owned by:
Priority: major Milestone: 1.8.1
Component: ui.autocomplete Version: 1.8rc3
Keywords: keyboard Cc:
Blocked by: Blocking:

Autocomplete prevents form submission when you choose an item with the Enter key. I can understand how this is desirable in many cases, but I happen to have a case where I'd like to immediately submit the form once an option is chosen. Would it be possible to make this behaviour configurable?

Attachments (0)
Change History (5)

Changed March 15, 2010 08:25PM UTC by rdworth comment:1

resolution: → worksforme
status: newclosed

Changed March 16, 2010 12:35AM UTC by scottgonzalez comment:2

milestone: TBD1.8
priority: minormajor
resolution: worksforme
status: closedreopened
type: featurebug

This is a bug. We're changing the semantics of form elements by canceling the event.

Changed March 16, 2010 01:25PM UTC by nigel comment:3

You can't use the change event either, it fires at all sorts of other times.

I only want to control the handling of the enter key. Not submit the form every time the element changed.

Changed March 20, 2010 08:26PM UTC by scottgonzalez comment:4

resolution: → fixed
status: reopenedclosed

Fixed in 1ddd4f5d3f83e1612cdbcf7039d01619b62c8a05.

You can now do:

$( el ).autocomplete({
    select: function( event ) {
        if ( event.keyCode === 13 ) {
            // handle enter key selection

Changed April 21, 2010 01:17PM UTC by rdworth comment:5