Skip to content

Commit

Permalink
Defer placement of autocomplete menu.
Browse files Browse the repository at this point in the history
In IE the layout of the input element sometimes is not determinable if the
autocomplete widget is being initialized early in the page loading process.
The sizes specs coming back from IE are all 0.

There might be a more elegant/robust solution to this problem but simply
surrounded the positioning with an anonymous defer seems to solve the problem
in my app.
  • Loading branch information
eric1234 authored and madrobby committed Mar 30, 2010
1 parent e67e021 commit edf8068
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/ui/controls/autocompleter.js
Expand Up @@ -40,11 +40,13 @@
this.element.insert(this.menu.element);

// Position the menu to appear directly below the input.
var iLayout = this.input.getLayout();
this.menu.element.setStyle({
left: iLayout.get('left') + 'px',
top: (iLayout.get('top') + iLayout.get('margin-box-height')) + 'px'
});
(function() {
var iLayout = this.input.getLayout();
this.menu.element.setStyle({
left: iLayout.get('left') + 'px',
top: (iLayout.get('top') + iLayout.get('margin-box-height')) + 'px'
});
}).bind(this).defer();

this.observers = {
blur: this._blur.bind(this),
Expand Down

0 comments on commit edf8068

Please sign in to comment.