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

Crash when .ui-select-dropdown is missing #1172

Closed
vivainio opened this issue Aug 31, 2015 · 1 comment
Closed

Crash when .ui-select-dropdown is missing #1172

vivainio opened this issue Aug 31, 2015 · 1 comment

Comments

@vivainio
Copy link

Repro: have choices.tpl.html that doesn't have ui-select-dropdown class in ui-select-choices

The offending code in uiSelectDirective.js only check the result for null-ness, not empty list (and tries to access the first element of the list)

        // Support changing the direction of the dropdown if there isn't enough space to render it.
        scope.$watch('$select.open', function(isOpen) {
          if (isOpen) {
            dropdown = angular.element(element).querySelectorAll('.ui-select-dropdown');
            if (dropdown === null) {
              return;
            }

            // Hide the dropdown so there is no flicker until $timeout is done executing.
            dropdown[0].style.opacity = 0;
@user378230
Copy link
Contributor

Closing this as not really a bug.

ui-select-dropdown is required for library to function so simply don't delete it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants