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

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.