Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid ResizeObserver loop limit exceeded #335

Merged
merged 1 commit into from Aug 16, 2018

Conversation

kristw
Copy link
Collaborator

@kristw kristw commented Aug 15, 2018

馃悰 Bug Fix

  • Avoid ResizeObserver loop limit exceeded. The issues surfaces on Chrome version >=64.

since ResizeObserver seems to be firing the callback immediately after observe() is called, this causes an infinite loop.

Reference: WICG/resize-observer#38

Solution was to wrap the resize call in requestAnimationFrame to avoid infinite loop

Reference:

cc: @michellethomas

@williaster
Copy link
Collaborator

nice 馃檶 LGTM 馃攣

were we seeing this on dashboards? is it specific to browser versions? (I haven't seen it before, or haven't been aware of seeing it :)

@kristw
Copy link
Collaborator Author

kristw commented Aug 16, 2018

@williaster @michellethomas found it while working on integration test in Cypress. It crashes the test on dashboard page.

Copy link
Member

@hshoff hshoff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR @kristw!

@hshoff hshoff merged commit ef0c34d into airbnb:master Aug 16, 2018
@hshoff hshoff added this to the v0.0.172 milestone Aug 16, 2018
@hshoff
Copy link
Member

hshoff commented Aug 16, 2018

published in v0.0.172: https://github.com/hshoff/vx/releases/tag/v0.0.172

shlomiassaf added a commit to shlomiassaf/ngrid that referenced this pull request May 8, 2019
fix(ngrid): Avoid ResizeObserver loop limit exceeded
See airbnb/visx#335
FezVrasta added a commit to FezVrasta/react-virtuoso that referenced this pull request Jul 30, 2019
Copies the approach used in airbnb/visx#335 to fix a "ResizeObserver loop limit exceeded" error
FezVrasta added a commit to FezVrasta/react-virtuoso that referenced this pull request Jul 30, 2019
Copies the approach used in airbnb/visx#335 to fix a "ResizeObserver loop limit exceeded" error
FezVrasta added a commit to FezVrasta/react-virtuoso that referenced this pull request Jul 30, 2019
Copies the approach used in airbnb/visx#335 to fix a "ResizeObserver loop limit exceeded" error

# Conflicts:
#	src/Utils.tsx
FezVrasta added a commit to FezVrasta/react-virtuoso that referenced this pull request Aug 1, 2019
Copies the approach used in airbnb/visx#335 to fix a "ResizeObserver loop limit exceeded" error
FezVrasta added a commit to FezVrasta/react-virtuoso that referenced this pull request Aug 1, 2019
Copies the approach used in airbnb/visx#335 to fix a "ResizeObserver loop limit exceeded" error
@kristw kristw deleted the resize-observer-limit branch August 17, 2020 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants