Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

fix: appendToBody doesn't work with jQuery < 1.10.0, fix for #944 #943

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions src/uiSelectDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,7 @@ uis.directive('uiSelect',
}

if (!contains && !$select.clickTriggeredSelect) {
var skipFocusser;
if (!$select.skipFocusser) {
//Will lose focus only with certain targets
var focusableControls = ['input','button','textarea','select'];
var targetController = angular.element(e.target).controller('uiSelect'); //To check if target is other ui-select
skipFocusser = targetController && targetController !== $select; //To check if target is other ui-select
if (!skipFocusser) skipFocusser = ~focusableControls.indexOf(e.target.tagName.toLowerCase()); //Check if target is input, button or textarea
} else {
skipFocusser = true;
}
$select.close(skipFocusser);
$select.close(true);
scope.$digest();
}
$select.clickTriggeredSelect = false;
Expand Down Expand Up @@ -298,7 +288,8 @@ uis.directive('uiSelect',
}

// Move the dropdown element back to its original location in the DOM
placeholder.replaceWith(element);
placeholder.after(element);
placeholder.remove();
placeholder = null;

element[0].style.position = '';
Expand Down