Skip to content

Commit

Permalink
fix(zepto): .is() only accepts selectors, reworked code to use pure DOM
Browse files Browse the repository at this point in the history
Zepto's .is only support selectors, not dom nodes: http://zeptojs.com/#is
DOMElement.contains() works on all browsers (IE5).

fixes #144
  • Loading branch information
vvo committed Jan 23, 2017
1 parent c11e010 commit a47a4d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/autocomplete/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function Typeahead(o) {
// #351: preventDefault won't cancel blurs in ie <= 8
$input.on('blur.aa', function($e) {
var active = document.activeElement;
if (_.isMsie() && ($menu.is(active) || $menu.has(active).length > 0)) {
if (_.isMsie() && ($menu[0] === active || $menu[0].contains(active))) {
$e.preventDefault();
// stop immediate in order to prevent Input#_onBlur from
// getting exectued
Expand Down

0 comments on commit a47a4d4

Please sign in to comment.