mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-16 23:39:44 +02:00
Fixed: Movies table not resizing properly when window size changed
This commit is contained in:
parent
e139e7330e
commit
7f71caaf7f
@ -95,6 +95,8 @@ function MovieIndexTable(props: MovieIndexTableProps) {
|
|||||||
const listRef: React.MutableRefObject<List> = useRef();
|
const listRef: React.MutableRefObject<List> = useRef();
|
||||||
const [measureRef, bounds] = useMeasure();
|
const [measureRef, bounds] = useMeasure();
|
||||||
const [size, setSize] = useState({ width: 0, height: 0 });
|
const [size, setSize] = useState({ width: 0, height: 0 });
|
||||||
|
const windowWidth = window.innerWidth;
|
||||||
|
const windowHeight = window.innerHeight;
|
||||||
|
|
||||||
const rowHeight = useMemo(() => {
|
const rowHeight = useMemo(() => {
|
||||||
return showBanners ? 70 : 38;
|
return showBanners ? 70 : 38;
|
||||||
@ -105,8 +107,8 @@ function MovieIndexTable(props: MovieIndexTableProps) {
|
|||||||
|
|
||||||
if (isSmallScreen) {
|
if (isSmallScreen) {
|
||||||
setSize({
|
setSize({
|
||||||
width: window.innerWidth,
|
width: windowWidth,
|
||||||
height: window.innerHeight,
|
height: windowHeight,
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -119,10 +121,10 @@ function MovieIndexTable(props: MovieIndexTableProps) {
|
|||||||
|
|
||||||
setSize({
|
setSize({
|
||||||
width: width - padding * 2,
|
width: width - padding * 2,
|
||||||
height: window.innerHeight,
|
height: windowHeight,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [isSmallScreen, scrollerRef, bounds]);
|
}, [isSmallScreen, windowWidth, windowHeight, scrollerRef, bounds]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const currentScrollListener = isSmallScreen ? window : scrollerRef.current;
|
const currentScrollListener = isSmallScreen ? window : scrollerRef.current;
|
||||||
|
Loading…
Reference in New Issue
Block a user