@sovereignfs/ui 0.21.2 → 0.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Dialog.module.css
CHANGED
|
@@ -48,11 +48,15 @@
|
|
|
48
48
|
.content {
|
|
49
49
|
flex: 1 1 auto;
|
|
50
50
|
overflow-y: auto;
|
|
51
|
+
overflow-x: hidden;
|
|
51
52
|
padding: var(--sv-space-6);
|
|
52
|
-
/*
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
/* Disable elastic overscroll within the dialog: `none` stops both scroll-
|
|
54
|
+
chaining to the parent and the iOS rubber-band bounce inside the panel.
|
|
55
|
+
`contain` only prevents chaining — the panel itself still bounces, which
|
|
56
|
+
reveals white panel-background between the mobileBar and the sticky tab
|
|
57
|
+
strip on iOS PWA. A dialog is a bounded surface where bounce is a visual
|
|
58
|
+
bug, not a feature. */
|
|
59
|
+
overscroll-behavior: none;
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
/* Fixed sizes. `max-*: 100%` caps to the scrim's content box (viewport minus
|
package/dist/index.js
CHANGED
|
@@ -910,12 +910,12 @@ import { useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
|
910
910
|
function lockBodyScroll() {
|
|
911
911
|
const count = parseInt(document.body.dataset.scrollLocks ?? "0", 10);
|
|
912
912
|
document.body.dataset.scrollLocks = String(count + 1);
|
|
913
|
-
if (count === 0) document.body.style.
|
|
913
|
+
if (count === 0) document.body.style.overflowY = "hidden";
|
|
914
914
|
}
|
|
915
915
|
function unlockBodyScroll() {
|
|
916
916
|
const next = Math.max(0, parseInt(document.body.dataset.scrollLocks ?? "0", 10) - 1);
|
|
917
917
|
document.body.dataset.scrollLocks = String(next);
|
|
918
|
-
if (next === 0) document.body.style.
|
|
918
|
+
if (next === 0) document.body.style.overflowY = "";
|
|
919
919
|
}
|
|
920
920
|
|
|
921
921
|
// src/components/Dialog/Dialog.tsx
|
package/package.json
CHANGED
|
@@ -48,11 +48,15 @@
|
|
|
48
48
|
.content {
|
|
49
49
|
flex: 1 1 auto;
|
|
50
50
|
overflow-y: auto;
|
|
51
|
+
overflow-x: hidden;
|
|
51
52
|
padding: var(--sv-space-6);
|
|
52
|
-
/*
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
/* Disable elastic overscroll within the dialog: `none` stops both scroll-
|
|
54
|
+
chaining to the parent and the iOS rubber-band bounce inside the panel.
|
|
55
|
+
`contain` only prevents chaining — the panel itself still bounces, which
|
|
56
|
+
reveals white panel-background between the mobileBar and the sticky tab
|
|
57
|
+
strip on iOS PWA. A dialog is a bounded surface where bounce is a visual
|
|
58
|
+
bug, not a feature. */
|
|
59
|
+
overscroll-behavior: none;
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
/* Fixed sizes. `max-*: 100%` caps to the scrim's content box (viewport minus
|
package/src/scroll-lock.ts
CHANGED
|
@@ -2,15 +2,21 @@
|
|
|
2
2
|
// open simultaneously; the body stays locked until all of them close.
|
|
3
3
|
// Uses data-scroll-locks on <body> as a counter so concurrent callers
|
|
4
4
|
// don't clobber each other's lock state.
|
|
5
|
+
//
|
|
6
|
+
// Only locks overflow-y (not the shorthand overflow) so the stylesheet's
|
|
7
|
+
// overflow-x: hidden on html,body is never overridden. On Android, clearing
|
|
8
|
+
// the overflow shorthand causes a brief frame where overflow-x is also
|
|
9
|
+
// unlocked — content wider than the viewport can paint and the home screen
|
|
10
|
+
// appears to "blow out" after the overlay closes.
|
|
5
11
|
|
|
6
12
|
export function lockBodyScroll(): void {
|
|
7
13
|
const count = parseInt(document.body.dataset.scrollLocks ?? '0', 10);
|
|
8
14
|
document.body.dataset.scrollLocks = String(count + 1);
|
|
9
|
-
if (count === 0) document.body.style.
|
|
15
|
+
if (count === 0) document.body.style.overflowY = 'hidden';
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
export function unlockBodyScroll(): void {
|
|
13
19
|
const next = Math.max(0, parseInt(document.body.dataset.scrollLocks ?? '0', 10) - 1);
|
|
14
20
|
document.body.dataset.scrollLocks = String(next);
|
|
15
|
-
if (next === 0) document.body.style.
|
|
21
|
+
if (next === 0) document.body.style.overflowY = '';
|
|
16
22
|
}
|