Skip to content
Snippets Groups Projects
Commit 5df9dafa authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #625170 by roborn, stBorchert, casey, sun, amateescu: autocomplete popup position.

parent cfc01f0a
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -172,6 +172,8 @@ Drupal.jsAC.prototype.hidePopup = function (keycode) {
* Positions the suggestions popup and starts a search.
*/
Drupal.jsAC.prototype.populatePopup = function () {
var $input = $(this.input);
var position = $input.position();
// Show popup.
if (this.popup) {
$(this.popup).remove();
......@@ -180,11 +182,12 @@ Drupal.jsAC.prototype.populatePopup = function () {
this.popup = $('<div id="autocomplete"></div>')[0];
this.popup.owner = this;
$(this.popup).css({
marginTop: this.input.offsetHeight + 'px',
width: (this.input.offsetWidth - 4) + 'px',
top: parseInt(position.top + this.input.offsetHeight, 10) + 'px',
left: parseInt(position.left, 10) + 'px',
width: $input.innerWidth() + 'px',
display: 'none'
});
$(this.input).before(this.popup);
$input.before(this.popup);
// Do search.
this.db.owner = this;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment