Skip to main content

Search and Top Navigation

#9499 closed bug (notabug)

Opened August 15, 2013 02:44PM UTC

Closed August 15, 2013 03:07PM UTC

Last modified August 16, 2013 02:31PM UTC

ajaxStart to show dialog cancels autocomplete

Reported by: Ash Vince Owned by:
Priority: minor Milestone: none
Component: ui.core Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

I have an generic ajaxStart covering and entire site that uses dialog.show() to popup a dialog. This works but fine over the entire site but in once place I also use autocomplete going to a url to get the data via ajax and this no longer seems to fire as a result of the ajaxstart showdialog. The dialog does show and a successfully gets the data but the autocomplete never appears.

I have tried to create a jsFiddle showing this but I do think this will work for autocomplete unfortunately.

Attachments (0)
Change History (7)

Changed August 15, 2013 03:07PM UTC by scottgonzalez comment:1

resolution: → notabug
status: newclosed

Sounds like the dialog is gaining focus before the ajax request completes and therefore the autocomplete field has no reason to show suggestions since it's not focused. Please ask for help on the forums, or provide a fiddle showing the actual problem.

Changed August 15, 2013 05:02PM UTC by Ash Vince comment:2

I don't think its a focus issue as the cursor is still flashing in the textbox and typing another character works.

Someone else had the same problem here: http://stackoverflow.com/questions/17686204/ajaxstart-cancels-jquery-autocomplete

Sorry I could not provide a fiddle earlier but it took me some time to figure out how. Here it is now:

http://jsbin.com/uqewoh

This only seems to not work in jquery 1.8 and older. If you change the fiddle to use latest and greatest jquery you do not see the dialog at all.

Changed August 15, 2013 05:55PM UTC by scottgonzalez comment:3

It only looks like focus is still there because you're waiting for the dialog to close. When the dialog closes, focus is restored. The reason the fiddle breaks with newer jQuery core is because you're using the global ajax events in a deprecated way.

Changed August 16, 2013 10:22AM UTC by Ash Vince comment:4

So is this a bug or not? In my test case above the autocomplete clearly does not work and jqueryui does say it supports jquery 1.8.

Changed August 16, 2013 11:48AM UTC by Ash Vince comment:5

I have created another test case here: http://jsbin.com/uqewoh/3/edit

This shows the problem with latest jquery and jqueryui but I guess this is a can't fix / won't fix problem.

Changed August 16, 2013 12:52PM UTC by scottgonzalez comment:6

It's neither can't fix nor won't fix. It's not a bug, for exactly the reason I explained. The autocomplete works just fine; stop stealing focus from it with a dialog. You won't get any more responses on this ticket. Support is in IRC, the forums, and Stack Overflow.

Changed August 16, 2013 02:31PM UTC by Ash Vince comment:7

Sorry, I didn't understand what was taking the focus as I do not have any buttons in the dialog but then I realised the close button was just hidden via css. Sorry for being dozy.