-
Notifications
You must be signed in to change notification settings - Fork 6.7k
TypeError: Cannot read property 'offsetHeight' of null #6221
Comments
Same problem here |
I was able to replicate it using a menu that overlaps a button with a tool-tip, when you click the menu and change navigation (i.e. the button with tool-tip is no longer there), you get the error. Seems the button is briefly available and triggers the tool-tip show as the menu disappears, but then the item is removed, and the timeout isn't cancelled |
Same problem here. Reproducing randomly, but usually related to a tooltip in a button which a) changes the width of a div i.e. visible area b) triggers a state transition into a new state. |
Same error here. Random. |
Any updates on this issue? I have same error too, randomly after clicking to open the popover. The popover seems opened fine, but the error is shown. |
Here is a Plunk: In chrome. open debug window with F12. You will eventually see the error in the console. |
A downgrade to |
But there's no version 1.1.3 to download at least from here: https://cdnjs.com/libraries/angular-ui-bootstrap/. Do you @krnlde know nearest version that works? |
1.3.3 sorry. I put the following semver in my bower.json: |
Anyone already studied how many features and fixes are missing from that version compared to latest? |
I was looking for the same (a changelog or at least some release notes), but couldn't find a thing. Though https://github.com/angular-ui/bootstrap/releases hints that 1.3.3 is the last major 1. A major version bump could potentially introduce breaking API changes if the devs comply to the semver scheme. I didn't experience any, but I'm not using the full range angular bootstrap has to offer. To the devs: https://github.com/blog/1547-release-your-software |
Wrapping this |
Seems to happen for me when navigating to another view with ui-router while tooltip is present on a page (like browser back button / mouse side button while over element with tooltip) |
Yeah that could fix it. Interestingly, for me the popover is still shown fine, through there seems to be a delay, in case of that error, |
This is caused by a race condition where the tooltip/popover open and close events are being called back to back. If you use popover-popup-delay="250" it should give enough of delay to mitigate the race condition. |
popover-popup-delay does not help. try it in my plunk. Downgrade to 1.3.3 means you have to change back to A simple |
@Rouche Yes it does. here is a plunk with the delay set to 500 and I can't get the error to occur (sorry, 250 was not long enough). I'm not suggesting this is the final solution, but it can be an effective work around until #6226 lands. We should have a default delay set on the tooltip to avoid getting in the race condition in the first place. |
Sorry rob. A bit harder with 500 yes, you need to be straight between the 2 digests. But the problem will always arrise. Just need to wait 500 to resize back to below 400 and... poof! angular.js:13920 TypeError: Cannot read property 'offsetHeight' of null |
for this issue, why not in at line 180:
|
Please any updates on this issue? 😅 Can the null-check addition here cause the popover not to show or some other issue? It seems an easier fix than using the delay, because not everyone needs the delay. |
@ngson Seems like the angular.isDefined is not a good check for as it will give a true and tooltip.offsetHeight will be null when there is a quick page change. Instead, I have used this to check for a valid value: No more errors for now. |
OK @shenlong, thank you for the info. So we just need to make a PR based on your suggestion and then release new version with this fix? |
Uhmm, how can I request for push permission to this repo? 😅 |
Uhmm, sorry for repeating my self, but how can I request for push permission to this repo? 😅 |
Bug description:
I am seeing regular occurrences of this exception in browsers. The sourcemapped stack trace appears to point to code inside the distributed angular-ui bootstrap module:
It would appear that
tooltip
in the above is null, which corresponds to:bootstrap/src/tooltip/tooltip.js
Line 164 in f5ff12c
Of course, checking for angular being non null is the easy solution but that may be a bandaid to the real problem rather than the cure.
Link to minimally-working plunker that reproduces the issue:
Sorry, I am yet to figure out exactly what causes this, other than a suspicion that it's rapidly hovering tooltips.
Version of Angular, UIBS, and Bootstrap
Angular: 1.5.8
UIBS: 2.1.3
Bootstrap: 3.3.7
The text was updated successfully, but these errors were encountered: