react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

Fallback for contentBoxSize

Open masonicboom opened this issue 2 years ago • 0 comments

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.

masonicboom avatar Aug 02 '22 03:08 masonicboom