Prevent TypeError (#712)
Somehow the grid ref was undefined after the resize observer was already connected. This should not be possible, so just disconnect the observer in case this still happens
This commit is contained in:
@@ -283,8 +283,8 @@ export const MangaGrid: React.FC<IMangaGridProps> = (props) => {
|
||||
return () => {};
|
||||
}
|
||||
|
||||
const resizeObserver = new ResizeObserver(() => {
|
||||
const gridHeight = gridRef.current!.offsetHeight;
|
||||
const resizeObserver = new ResizeObserver((entries) => {
|
||||
const gridHeight = entries[0].target.clientHeight;
|
||||
const isScrollbarVisible = gridHeight > document.documentElement.clientHeight;
|
||||
|
||||
if (!gridHeight) {
|
||||
|
||||
Reference in New Issue
Block a user