Skip to content

fix(tooltip): tooltips while zoomed can cause tab to crash #3047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
eric-simonton-sama opened this issue Nov 16, 2017 · 6 comments
Open

fix(tooltip): tooltips while zoomed can cause tab to crash #3047

eric-simonton-sama opened this issue Nov 16, 2017 · 6 comments

Comments

@eric-simonton-sama
Copy link

Bug description or feature request:

This was by far the strangest bug I've had to track down in a web app.

Simply mousing over to show a tooltip can cause the entire browser tab to hang given the right magic combination of circumstances, becoming unresponsive and using 100% CPU. We have seen it on Chrome (which we use exclusively), and only when using the zoom feature within the browser. This happens for both Mac and Windows users. One user also experienced the problem while using zoom within the display settings of Windows.

Plunker/StackBlitz that reproduces the issue:

Unfortunately I have not yet been able to reproduce this issue in a Plunker. I do have a link that I can share with someone privately to reproduce the issue, just let me know the best way to get that link to the right person. Perhaps over a Direct Message in Slack?

Here was my best effort at a plunker, but it does not exhibit the issue. It has all the stuff that I thought might be relevant, but I must be missing something. Maybe it is still a good starting place to experiment, though, which is why I'm still sharing the link.

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 1.9.3

Angular: 4.4.6

Bootstrap: 3.3.7 (of bootstrap-sass)

Build system: Angular CLI, System.js, webpack, starter seed:

Webpack, via the webpacker gem for rails.

@IlyaSurmay
Copy link
Contributor

IlyaSurmay commented Nov 17, 2017

That's strange. I couldn't reproduce it in demo or plunkr, so please drop a link in DM here

@eric-simonton-sama
Copy link
Author

I think I found the secret sauce to reproduce the issue. Give this plunker a try at different zoom levels, mousing over the buttons to see if they lock up the browser.

The secret was to combine tooltips with resize-observer-polyfill.

For me on Chrome it locks up at 90% and 125%, but not at 100% or 110%.

@que-etc
Copy link

que-etc commented Nov 22, 2017

It seems like this issue has something to do with MutationObserver and zone.js.

An updated sample (without ResizeObserver) which produces the same effect.

@eric-simonton-sama
Copy link
Author

eric-simonton-sama commented Nov 22, 2017

Thank you much for your investigation! Here is the same update, still without using ResizeObserver, and with some unnecessary config and code removed.

@eric-simonton-sama
Copy link
Author

Interesting info was added by the zone.js team here, including a workaround that we can probably work with on our end for now: https://github.com/angular/zone.js/issues/962#issuecomment-346521952

They point out that they infinite loop goes through ngbootstrap.positionService.positionElements, so that sounds like a good place to look while continuing to troubleshoot this issue within ngx-bootstrap.

@hisham
Copy link

hisham commented Feb 21, 2019

I recently upgraded to 3.3.0 and I am also running into hangs when triggering tooltip, and only in production build. I reverted to 3.2.0 and the hang seems gone now...

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

No branches or pull requests

6 participants