This repository was archived by the owner on Oct 2, 2019. It is now read-only.
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
Focusing different element does not work properly when using append-to-body #1624
Open
Description
Bug description:
- Focus the select element and interact with it in any way you like (select some options, filter stuff etc.)
- Click on a different element (a regular input for instance)
- The focus remains on the select element
This only happens when append-to-body is true due to this piece of code:
var appendToBody = scope.$eval(attrs.appendToBody);
if (appendToBody !== undefined ? appendToBody : uiSelectConfig.appendToBody) {
scope.$watch('$select.open', function(isOpen) {
if (isOpen) {
positionDropdown();
} else {
resetDropdown();
}
});
It calls resetDropdown() which calls the focus method deeper down.
Link to minimally-working plunker that reproduces the issue:
Version of Angular, UI-Select, and Bootstrap/Select2/Selectize CSS
Angular: 1.5.0
UI-Select: 0.17.1
Bootstrap/Select2/Selectize CSS (if applicable):