Skip to content
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
@pedroclayman

Description

@pedroclayman

Bug description:

  1. Focus the select element and interact with it in any way you like (select some options, filter stuff etc.)
  2. Click on a different element (a regular input for instance)
  3. 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:

plnkr here

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):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions