#7643 closed bug (worksforme)
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
Change History (8)
comment:1 follow-up: 2 Changed 12 years ago by
Owner: | set to jesus.altamir |
---|---|
Status: | new → pending |
comment:2 Changed 12 years ago by
Status: | pending → new |
---|
Replying to 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
comment:3 follow-up: 4 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Works fine for me: http://jsbin.com/adicaq/edit#javascript,html
comment:4 Changed 12 years ago by
Replying to 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.
comment:6 Changed 12 years ago by
Replying to 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.
comment:7 follow-up: 8 Changed 12 years ago by
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.
comment:8 Changed 11 years ago by
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.
Please provide more detail and a reduced (non-ASP) example.