mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-06-20 05:21:00 +02:00
Fix modals on iOS
This commit is contained in:
@@ -30,12 +30,6 @@
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.modalOpenIOS {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sizes
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,6 @@ interface CssExports {
|
||||
'modalBackdrop': string;
|
||||
'modalContainer': string;
|
||||
'modalOpen': string;
|
||||
'modalOpenIOS': string;
|
||||
'small': string;
|
||||
}
|
||||
export const cssExports: CssExports;
|
||||
|
||||
@@ -71,7 +71,6 @@ function Modal({
|
||||
}: ModalProps) {
|
||||
const backgroundRef = useRef<HTMLDivElement>(null);
|
||||
const isBackdropPressed = useRef(false);
|
||||
const bodyScrollTop = useRef(0);
|
||||
const wasOpen = usePrevious(isOpen);
|
||||
const modalId = useId();
|
||||
|
||||
@@ -128,8 +127,6 @@ function Modal({
|
||||
if (openModals.length === 1) {
|
||||
if (isIOS()) {
|
||||
setScrollLock(true);
|
||||
bodyScrollTop.current = document.body.scrollTop;
|
||||
elementClass(document.body).add(styles.modalOpenIOS);
|
||||
} else {
|
||||
elementClass(document.body).add(styles.modalOpen);
|
||||
}
|
||||
@@ -138,11 +135,8 @@ function Modal({
|
||||
removeFromOpenModals(modalId);
|
||||
|
||||
if (openModals.length === 0) {
|
||||
setScrollLock(false);
|
||||
|
||||
if (isIOS()) {
|
||||
elementClass(document.body).remove(styles.modalOpenIOS);
|
||||
document.body.scrollTop = bodyScrollTop.current;
|
||||
setScrollLock(false);
|
||||
} else {
|
||||
elementClass(document.body).remove(styles.modalOpen);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user