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

Tooltip $apply in progress error when using focus trigger #3557

Closed
chrisirhc opened this issue Apr 17, 2015 · 2 comments · Fixed by #4455
Closed

Tooltip $apply in progress error when using focus trigger #3557

chrisirhc opened this issue Apr 17, 2015 · 2 comments · Fixed by #4455

Comments

@chrisirhc
Copy link
Contributor

Reported by @gufigueiredo in #516

Another scenario:

If i use tooltip with "tooltip-trigger=focus" and ui-datepicker, same error occurs:

                    <div class="form-group">
                        <label for="DateField" class="required">Date Field</label>
                            <div class="input-group date">
                              <input name="DateField" type="text" class="form-control" 
                                     tooltip="Choose a date"
                                     tooltip-trigger="focus"
                                     datepicker-popup="dd/MM/yyyy" 
                                     ng-model="vm.DateField" 
                                     is-open="vm.opened" 
                                     show-button-bar="false" />
                              <span class="input-group-btn">
                                <button type="button" class="btn btn-default" ng-click="vm.open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                              </span>
                            </div>
                        </div>

Most likely due to the fact that blur events must be handled with evalAsync.

@bretkikehara
Copy link

Please let me know your thoughts and if it is good, then I will make a PR! =]

master...bretkikehara:0.13.4

The tooltip should prefer to applyAsync or evalAsync because it doesn't matter if the commands are run on this tick or next tick. We have two cases, 1 where the digest cycle is running and 2 where it is not. If we applyAsync or evalAsync, it ensure the commands are executed without interfering with the digest cycle. Even if the same code is executed in two digest cycles, there isn't any negative side effect.

Why do we need to create the tooltip? Please correct me if I am wrong, but the tooltip should be inserted into the DOM once per "open" trigger and removed from the DOM after "close" trigger. Hence, even if the browser fire multiple "open" triggers, the createTooltip should fail silently as the tooltip is already in the DOM.

@RobJacobs
Copy link
Contributor

LGTM a PR off current master would be great.

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.

4 participants