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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback for contentBoxSize #2980

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

masonicboom
Copy link

This PR adds support for browsers that don't have contentBoxSize, like iOS Safari prior to iOS 15.4. Fixes errors like TypeError: undefined is not an object (evaluating 'entries[0].contentBoxSize[0]').

To repro, on macOS:

  1. Install Xcode.
  2. Install https://developer.apple.com/safari/technology-preview/.
  3. Go to Window > Devices and Simulators in the menu, and install iOS 13.7 simulator (for example).
  4. Run iOS 13.7 simulator, any device.
  5. Open Safari (in sim) and navigate to https://adazzle.github.io/react-data-grid.
  6. Open Safari Technology Preview
  7. In Safari Technology Preview go to Develop > Simulator you ran > adazzle.github.io, then switch to the Console tab when dev tools appears
  8. In Safari Technology Preview dev tools, hit command+R to reload. You should see something like this screenshot.

Screen Shot 2022-08-01 at 8 22 13 PM

I tested this PR against my own app, but you should also be able to confirm the fix with steps like those above.

For reference: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/contentRect.

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.

1 participant