Created
February 15, 2012 20:22
-
-
Save rgrove/1838761 to your computer and use it in GitHub Desktop.
Monkeypatch for YUI AutoComplete 3.4.x list being hidden after scrolling using a scrollbar on the contentBox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Y.AutoCompleteList.prototype._bindList = function () { | |
this._listEvents.concat([ | |
Y.one('doc').after('click', this._afterDocClick, this), | |
Y.on('windowresize', this._syncPosition, this), | |
this.after({ | |
blur : this._afterListBlur, | |
focus : this._afterListFocus, | |
mouseover: this._afterMouseOver, | |
mouseout : this._afterMouseOut, | |
activeItemChange : this._afterActiveItemChange, | |
alwaysShowListChange: this._afterAlwaysShowListChange, | |
hoveredItemChange : this._afterHoveredItemChange, | |
resultsChange : this._afterResultsChange, | |
visibleChange : this._afterVisibleChange | |
}), | |
this._listNode.delegate('click', this._onItemClick, | |
this['_SELECTOR_ITEM'], this) | |
]); | |
}; | |
Y.AutoCompleteList.prototype._afterDocClick = function (e) { | |
var boundingBox = this._boundingBox, | |
target = e.target; | |
if (target !== this._inputNode && target !== boundingBox && | |
!boundingBox.one(target.get('id'))) { | |
this.hide(); | |
} | |
}; | |
Y.AutoCompleteList.prototype._afterMouseOut = function () { | |
this._mouseOverList = false; | |
this._set('hoveredItem', null); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment