Auto-complete issue in bootstrap modal

I have a problem with jQuery auto-completion displaying inside a modal dialog bootstrap.

When you scroll the mouse, the results do not remain attached to the input.

Is there any way to solve this problem?

Here's the JsFiddle :

.ui-autocomplete-input { border: none; font-size: 14px; width: 300px; height: 24px; margin-bottom: 5px; padding-top: 2px; border: 1px solid #DDD !important; padding-top: 0px !important; z-index: 1511; position: relative; } 

EDIT I found a problem:

 .ui-autocomplete { position: fixed; ..... } 

If the modal has a scroll, the problem remains!

Here is JsFiddle / 1 .

+46
jquery twitter-bootstrap jquery-ui-autocomplete bootstrap-modal
Apr 21 '13 at 16:50
source share
10 answers

The position is correct, that it is "absolute", while you need to specify this as an autocomplete option:

 $( ".addresspicker" ).autocomplete( "option", "appendTo", ".eventInsForm" ); 

Where he can bind the box to the results in any element, I have to stop his binding to the form class!

JsFiddle works here! .

+73
Apr 21 '13 at 18:04 on
source share

The above solution talking about the z-index problem worked:

 .ui-autocomplete { z-index:2147483647; } 

Make sure you put it in front of the .js script responsible for handling the modal autocomplete logic.

+32
Aug 08 '13 at 15:05
source share

Check the appendTo documentation :

When null, the parents of the input field will be checked for the ui-front class. If the element is of ui-front class, a menu will be added to this element.

So, just add the "ui-front" class to the parent element , and autocomplete will correctly display inside the modal file.

+14
Jul 29 '14 at 17:57
source share

The actual problem is that Bootstrap Modal has a higher Z-index than any other element on the page. Thus, automatic completion actually works, but it is hidden behind the dialog.

You just need to add this to any of the added css files:

 .ui-autocomplete { z-index:2147483647; } 
+7
Apr 29 '13 at 8:41
source share

With the addition of the "ui-front" class to the parent div, and autocomplete will correctly display inside PopUp For Me.

+7
Jul 16 '16 at 13:39
source share

just try adding this:

 .ui-autocomplete { z-index: 215000000 !important; } 

Just make sure you attach great importance to the property and DO ADD

important!

This is really important. The latter will tell the browser to execute this rule first before any other class. Hope this helps.

+2
Jan 20 '16 at 15:38
source share

To fix this, I just needed to modify the css file using jQuery:

 .ui-front { z-index: 9999; } 
0
Oct 08 '15 at 15:41
source share

Adding the appendTo option resolved this issue. He attached a menu to one of the objects in the bootstrap model.

0
Jan 08 '16 at 22:44
source share

I decided this ....

 /******************************************************************** * CORREZIONE PER L'AUTOCOMPLETE EXTENDER di AJAX TOOLKIt * ********************************************************************/ ul[id*='_completionListElem'] { z-index: 215000000 !important; } 

Autocomplete completion list autofill has utomated ID like this ID = '_ completionListElem'

so you have to click z-index .. top, then boot modal bar;)

Hope this helps

0
Sep 11 '17 at 16:42 on
source share
 .ui-front { z-index: 9999; } <div class="modal fade" id="myModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog ui-front"> <div class="modal-content"> <div class="modal-header"> </div> <div class="modal-body"> </div> </div> </div> </div> 
-one
Sep 28 '16 at 15:33
source share



All Articles