ss-support-widget 1.0.7 → 1.0.8
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/package.json +1 -1
- package/src/ChatWidget.tsx +18 -0
package/package.json
CHANGED
package/src/ChatWidget.tsx
CHANGED
|
@@ -54,6 +54,22 @@ export function ChatWidget({
|
|
|
54
54
|
endRef.current?.scrollIntoView({ behavior: "auto", block: "end" });
|
|
55
55
|
}, [open]);
|
|
56
56
|
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!(open && isMobile)) return;
|
|
59
|
+
|
|
60
|
+
const prevOverflow = document.documentElement.style.overflow;
|
|
61
|
+
const prevBodyOverflow = document.body.style.overflow;
|
|
62
|
+
|
|
63
|
+
document.documentElement.style.overflow = "hidden";
|
|
64
|
+
document.body.style.overflow = "hidden";
|
|
65
|
+
|
|
66
|
+
return () => {
|
|
67
|
+
document.documentElement.style.overflow = prevOverflow;
|
|
68
|
+
document.body.style.overflow = prevBodyOverflow;
|
|
69
|
+
};
|
|
70
|
+
}, [open, isMobile]);
|
|
71
|
+
|
|
72
|
+
|
|
57
73
|
return (
|
|
58
74
|
<Box sx={anchorSx}>
|
|
59
75
|
{!open && (
|
|
@@ -172,6 +188,8 @@ export function ChatWidget({
|
|
|
172
188
|
border: "3px solid transparent",
|
|
173
189
|
backgroundClip: "content-box",
|
|
174
190
|
},
|
|
191
|
+
overscrollBehavior: "contain",
|
|
192
|
+
WebkitOverflowScrolling: "touch",
|
|
175
193
|
}}
|
|
176
194
|
>
|
|
177
195
|
{msgs.map((m) => {
|