Skip to main content

Search and Top Navigation

#7643 closed bug (worksforme)

Opened August 16, 2011 05:13AM UTC

Closed August 16, 2011 07:58PM UTC

Last modified April 24, 2012 09:17PM UTC

Clears the selection in all controls

Reported by: jesus.altamir Owned by: jesus.altamir
Priority: minor Milestone: 1.9.0
Component: ui.autocomplete Version: 1.8.15
Keywords: Cc:
Blocked by: Blocking:
Description

When a page is placed over a textbox(ASP.NET) with autocomplete functionality, pressing the escape key a second time clears all previous selections in the textbox

Attachments (0)
Change History (8)

Changed August 16, 2011 11:44AM UTC by scottgonzalez comment:1

owner: → jesus.altamir
status: newpending

Please provide more detail and a reduced (non-ASP) example.

Changed August 16, 2011 07:44PM UTC by jesus.altamir comment:2

status: pendingnew

Replying to [comment:1 scott.gonzalez]:

Please provide more detail and a reduced (non-ASP) example.

What happens is that I wanted to implement a project of jQuery in ASP.NET, so I started looking online and found an example of how to implement it, there all good, but when I put on one page 2 textbox happens that I do the search in each of them and when I press the escape key once more will clear all the textboxs to which he added auto-complete functionality. The example right out of the page:

http://www.esasp.net/2010/03/autocomplete-jquery-ui-en-aspnet.html

Changed August 16, 2011 07:58PM UTC by scottgonzalez comment:3

resolution: → worksforme
status: newclosed

Changed August 17, 2011 04:24PM UTC by jesus.altamir comment:4

Replying to [comment:3 scott.gonzalez]:

Works fine for me: http://jsbin.com/adicaq/edit#javascript,html

I just uploaded the example to a url that will end the message, I do the search in both textbox by entering the text "MA", select any of the list, once the two are already selected by pressing the escape 2 times and I clears the text of both.

http://aspspider.info/jesusaltamir/

Changed August 17, 2011 04:25PM UTC by scottgonzalez comment:5

1) No it doesn't.

2) Stop using a really old RC.

Changed August 17, 2011 04:54PM UTC by jesus.altamir comment:6

Replying to [comment:5 scott.gonzalez]:

1) No it doesn't. 2) Stop using a really old RC.

I just changed the rc for the jquery-ui-1.8.15.custom.min.js the link above, I tested the 2 browsers (IE8 and Google Chrome) and the second does not get this error.

Changed August 17, 2011 05:22PM UTC by scottgonzalez comment:7

There's some crazy behavior going on in that page with the escape button that has nothing to do with jQuery UI. Try pressing escape over and over. The value in the input will come and go.

Changed April 24, 2012 09:17PM UTC by r2363c comment:8

Hello,

I've just met the same issue, I develop on WEB for over a decade and I've just discovered that a double press on escape clear the entire form. Then I agree it's not due to JQuery UI.

However, the ESC behavior to close the listbox is the cause of the double press on escape key then I think it could make sense that this widget help to protect users.

I suggest to add a preventDefault() call on the keydown.autocomplete handle

Then I suggest to change the code (on minimized version)

case e.ESCAPE:b.element.val(b.term),b.close(c);break;

by

case e.ESCAPE:b.element.val(b.term),b.close(c);c.preventDefault();break;

I've tested it on IE6&8 and FF11 and chrome15 and it seems to fix the point on IE and to do not cause any trouble on others.

On the last source code (I haven't tested it) it should be

case keyCode.ESCAPE:
  if ( self.menu.element.is(":visible") ) {
	self._value( self.term );
	self.close( event );
    }
  event.preventDefault();
 break;

Hoping it can be integrated on future release of autocomplete.

jesus.altamir perhaps you should reopen this ticket to have this reply reported to dev team.