#9499 closed bug (notabug)
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.
Change History (7)
comment:1 Changed 9 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
comment:2 Changed 9 years ago by
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:
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.
comment:3 follow-up: 4 Changed 9 years ago by
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.
comment:4 Changed 9 years ago by
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.
comment:5 Changed 9 years ago by
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.
comment:6 Changed 9 years ago by
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.
comment:7 Changed 9 years ago by
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.
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.