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

Tooltip running digest when it trigger mouseleave even tooltip-enable attribute is false. #4321

Closed
lg314 opened this issue Sep 1, 2015 · 3 comments · Fixed by #4455
Closed

Comments

@lg314
Copy link

lg314 commented Sep 1, 2015

Mouseenter event should not run digest when tooltip-enable is false. I found the code triggered by mouseleave.

        function hideTooltipBind () {
          hide();
          if (!$rootScope.$$phase) {
            $rootScope.$digest();
          }
        }

I wonder whether it is necessary to run digest when the tooltip has never been opened.
http://plnkr.co/edit/7dUsCKFr6ZNtnZslHJW8?p=preview

@wesleycho
Copy link
Contributor

The value could potentially change to true, and then the tooltip could be activated down the line - we would have to guarantee that it closes properly.

@lg314
Copy link
Author

lg314 commented Sep 1, 2015

I tried to change the code like this. And it works good in my case. But it should be tested in other cases.

        function hideTooltipBind() {
            if (ttScope.isOpen) {
                hide();
                if (!$rootScope.$$phase) {
                    $rootScope.$digest();
                }
            }
            else if (ttScope.popupDelay && popupTimeout) {
                $timeout.cancel(popupTimeout);
                popupTimeout = null;
            }
        }

@wesleycho
Copy link
Contributor

Can you please explain things more clearly here? Your comment seems to be talking about something completely separate from the original post.

jasonaden pushed a commit to deskfed/bootstrap that referenced this issue Jan 8, 2016
This is a rollup commit intended to address several
issues around the positioning and parsing of
attributes.

- Fixes issue introduced under PR angular-ui#4311 where setting
  height and width in tooltip position function
  messed up arrow placement.
- Fixes issue introduced under PR angular-ui#4363 where setting
  visibility to hidden in tooltip position function
  caused elements in popover to lose focus.
- Fixes issue angular-ui#1780 where tooltip would render if
  content was just whitespace.
- Fixes issue angular-ui#3347 where tooltip isolate scope was
  being accessed after it was set to null.  Observers
  will now be created/destroyed as tooltip opens/closes
  which will also offer a performance improvement.
- Fixes issue angular-ui#3557 by implementing evalAsync to set
  tooltip scope isOpen property.
- Fixes issue angular-ui#4335 where if model isOpen property is
  undefined, tooltip would call show/hide toggle function.
- Closes PR angular-ui#4429 where how the templated content
  was being evaluated could cause an infinite digest loop.

Closes angular-ui#4400
Closes angular-ui#4418
Closes angular-ui#4429
Closes angular-ui#4431
Closes angular-ui#4455

Fixes angular-ui#1780
Fixes angular-ui#3347
Fixes angular-ui#3557
Fixes angular-ui#4321
Fixes angular-ui#4335
jasonaden pushed a commit to deskfed/bootstrap that referenced this issue Jan 8, 2016
This is a rollup commit intended to address several
issues around the positioning and parsing of
attributes.

- Fixes issue introduced under PR angular-ui#4311 where setting
  height and width in tooltip position function
  messed up arrow placement.
- Fixes issue introduced under PR angular-ui#4363 where setting
  visibility to hidden in tooltip position function
  caused elements in popover to lose focus.
- Fixes issue angular-ui#1780 where tooltip would render if
  content was just whitespace.
- Fixes issue angular-ui#3347 where tooltip isolate scope was
  being accessed after it was set to null.  Observers
  will now be created/destroyed as tooltip opens/closes
  which will also offer a performance improvement.
- Fixes issue angular-ui#3557 by implementing evalAsync to set
  tooltip scope isOpen property.
- Fixes issue angular-ui#4335 where if model isOpen property is
  undefined, tooltip would call show/hide toggle function.
- Closes PR angular-ui#4429 where how the templated content
  was being evaluated could cause an infinite digest loop.

Closes angular-ui#4400
Closes angular-ui#4418
Closes angular-ui#4429
Closes angular-ui#4431
Closes angular-ui#4455

Fixes angular-ui#1780
Fixes angular-ui#3347
Fixes angular-ui#3557
Fixes angular-ui#4321
Fixes angular-ui#4335
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants