Prevent "migrate dialog" from closing
Due to the scrollbar disappearing the dimension of the manga grid items changed which caused them to get unmounted and re-rendered again. This then caused the dialog to get closed since the dialog is rendered in the manga grid item component
This commit is contained in:
@@ -269,6 +269,10 @@ export const MangaGrid: React.FC<IMangaGridProps> = ({
|
|||||||
|
|
||||||
// always show vertical scrollbar to prevent https://github.com/Suwayomi/Suwayomi-WebUI/issues/758
|
// always show vertical scrollbar to prevent https://github.com/Suwayomi/Suwayomi-WebUI/issues/758
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
|
if (horizontal) {
|
||||||
|
return () => {};
|
||||||
|
}
|
||||||
|
|
||||||
// in case "overflow" is currently set to "hidden" that (most likely) means that a MUI modal is open and locks the scrollbar
|
// in case "overflow" is currently set to "hidden" that (most likely) means that a MUI modal is open and locks the scrollbar
|
||||||
// once this modal is closed MUI restores the previous "overflow" value, thus, reverting the just set "overflow" value
|
// once this modal is closed MUI restores the previous "overflow" value, thus, reverting the just set "overflow" value
|
||||||
let timeout: NodeJS.Timeout;
|
let timeout: NodeJS.Timeout;
|
||||||
@@ -291,6 +295,10 @@ export const MangaGrid: React.FC<IMangaGridProps> = ({
|
|||||||
}, [gridLayout]);
|
}, [gridLayout]);
|
||||||
useLayoutEffect(
|
useLayoutEffect(
|
||||||
() => () => {
|
() => () => {
|
||||||
|
if (horizontal) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
document.body.style.overflowY = 'auto';
|
document.body.style.overflowY = 'auto';
|
||||||
},
|
},
|
||||||
[],
|
[],
|
||||||
|
|||||||
Reference in New Issue
Block a user