Opened 8 years ago

Closed 8 years ago

#7752 closed bug (cantfix)

Pressing Escape after select event restores the value of the user input

Reported by: boyanpenev Owned by: boyanpenev
Priority: minor Milestone: 1.9.0
Component: ui.autocomplete Version: 1.8.16
Keywords: Cc:
Blocked by: Blocking:

Description

Hello,

when selecting an item from the autocomplete list and pressing escape afterwars- the selected item gets deleted and the value of the input before autocomplete is opened- restored.

To reproduce, one could use the default autocomplete demo http://jqueryui.com/demos/autocomplete/#default and take the following steps:

  1. Type in "ja"
  2. From the autocomplete list, select "Java"
  3. Press escape
  4. "Java" turns to "ja"

I tried to prevent escape from doing this with

if (!($(this).data('autocomplete').menu.active))
{
        return false;
}

but it didn't work out.

Best regards,

Boyan Penev

Change History (6)

comment:1 Changed 8 years ago by Scott González

Owner: set to boyanpenev
Status: newpending

I'm not seeing this behavior. Is this only happening in a particular browser?

comment:2 Changed 8 years ago by boyanpenev

Status: pendingnew

Apologies for the delayed answer and that I didn't investigate the browser differences myself. The behavior happens only with firefox (checked it only with the latest- 7.0.1). With internet explorer 7 through 9 and chrome the problem could not be reproduced.

comment:3 Changed 8 years ago by Scott González

Status: newopen

This isn't actually a bug in autocomplete. This is behavior that's built into Firefox. I'll try to find out why Mozilla implemented this, but it doesn't look like it's possible to override: http://jsbin.com/aqorex/2/edit

comment:4 Changed 8 years ago by Scott González

comment:5 Changed 8 years ago by Scott González

New bug that is likely going to be the first one fixed by Mozilla as Mounir has already created a patch: https://bugzilla.mozilla.org/show_bug.cgi?id=695014

comment:6 Changed 8 years ago by Scott González

Resolution: cantfix
Status: openclosed

I'm closing this bug since there's nothing we can do about it. However, I'm still tracking the Mozilla bugs.

Note: See TracTickets for help on using tickets.