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

Added "on-shown" attribute #1526

Closed
wants to merge 1 commit into from
Closed

Added "on-shown" attribute #1526

wants to merge 1 commit into from

Conversation

syabro
Copy link

@syabro syabro commented Mar 26, 2016

No description provided.

@syabro syabro mentioned this pull request Mar 26, 2016
@@ -112,6 +112,10 @@ uis.controller('uiSelectCtrl',

$scope.$broadcast('uis:activate');

$timeout(function(){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to do a $timeout?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I don't remember, but I guess it was added to be sure it's triggered after the main cycle.

@wesleycho
Copy link
Contributor

This needs changes to dist removed.

@syabro
Copy link
Author

syabro commented Mar 26, 2016

@wesleycho what do you mean by 'dist'? 😊 Remove dist changes?

@wesleycho
Copy link
Contributor

Click on the Files changed tab of this PR and you'll see what I mean.

@syabro
Copy link
Author

syabro commented Jun 20, 2016

Done, @wesleycho
Sorry for a delay

@user378230
Copy link
Contributor

user378230 commented Jun 24, 2016

Instead of adding separate timeout, couldn't you just call lower down...? Like here:

var container = $element.querySelectorAll('.ui-select-choices-content');
      if (ctrl.$animate && ctrl.$animate.on && ctrl.$animate.enabled(container[0])) {
        ctrl.$animate.on('enter', container[0], function (elem, phase) {
          if (phase === 'close') {
            // Only focus input after the animation has finished
            $timeout(function () {
              // <<<<<<<<<<<<<< HERE <<<<<<<<<<<<<<
              ctrl.focusSearchInput(initSearchValue);
            });
          }
        });
      } else {
        $timeout(function () {
          // <<<<<<<<<<<<<< AND HERE <<<<<<<<<<<<<<<
          ctrl.focusSearchInput(initSearchValue);
          if(!ctrl.tagging.isActivated && ctrl.items.length > 1) {
            _ensureHighlightVisible();
          }
        });
      }

@user378230
Copy link
Contributor

Superseded by #1723

@user378230 user378230 closed this Aug 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants