I have a display problem in the jQuery autocomplete inside a modal dialog bootstrap.
When I mouse scroll, the results do not remain attached to the input.
Is
The actual issue is that the Bootstrap Modal has a higher Z-index than any other element in the page. Thus, auto complete actually works - but it gets hidden behind the dialog.
You just need to add this in any of your added css
files:
.ui-autocomplete {
z-index:2147483647;
}
I solved by this....
/********************************************************************
* CORREZIONE PER L'AUTOCOMPLETE EXTENDER di AJAX TOOLKIt *
********************************************************************/
ul[id*='_completionListElem'] {
z-index: 215000000 !important;
}
Autocomplete extender completion list has an utomated ID like this id='_completionListElem'
so you must push up the z-index .. upper then the bootstrap modal panel ;)
Hope it helps
.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>
The position is right that it is "absolute", while you need to specify this as an option to autocomplete:
$( ".addresspicker" ).autocomplete( "option", "appendTo", ".eventInsForm" );
Where it can anchor the box with the results in any element, I have to stop it from being anchored to the form's class!
Here is a working JsFiddle!.
just try adding this:
.ui-autocomplete {
z-index: 215000000 !important;
}
Just make sure you give a high value to the property and DO ADD
!important
It really matters. The latter will tell your browser to execute this rule first, before any other of the same class. Hope it will help
The above solution talking about the z-index
issue worked:
.ui-autocomplete { z-index:2147483647; }
Make sure you put it before your .js
script responsible for handling the modal AND autocomplete logic.