Skip to content

Commit

Permalink
fix: safari useReszieObserver (#344)
Browse files Browse the repository at this point in the history
* fix: safari useReszieObserver

* fix: safari useReszieObserver
  • Loading branch information
orrgottlieb authored Nov 18, 2021
1 parent f5461a3 commit 1bca87a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useResizeObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function useResizeObserver({ ref, callback, debounceTime = 200 })
animationFrameId = borderBoxSizeCallback(borderBoxSize);
} else if (entry.contentRect) {
// handle safari (entry.contentRect)
const borderBoxSize = { blockSize: entry.contentRect.height };
const borderBoxSize = { blockSize: entry.contentRect.height, inlineSize: entry?.contentRect?.width || 0 };
animationFrameId = borderBoxSizeCallback(borderBoxSize);
} else {
return () => {};
Expand Down

0 comments on commit 1bca87a

Please sign in to comment.