ss-support-widget 1.0.7 → 1.0.9
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 +25 -0
package/package.json
CHANGED
package/src/ChatWidget.tsx
CHANGED
|
@@ -54,6 +54,29 @@ 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 scrollY = window.scrollY;
|
|
61
|
+
|
|
62
|
+
document.body.style.position = "fixed";
|
|
63
|
+
document.body.style.top = `-${scrollY}px`;
|
|
64
|
+
document.body.style.left = "0";
|
|
65
|
+
document.body.style.right = "0";
|
|
66
|
+
document.body.style.width = "100%";
|
|
67
|
+
|
|
68
|
+
return () => {
|
|
69
|
+
document.body.style.position = "";
|
|
70
|
+
document.body.style.top = "";
|
|
71
|
+
document.body.style.left = "";
|
|
72
|
+
document.body.style.right = "";
|
|
73
|
+
document.body.style.width = "";
|
|
74
|
+
window.scrollTo(0, scrollY);
|
|
75
|
+
};
|
|
76
|
+
}, [open, isMobile]);
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
57
80
|
return (
|
|
58
81
|
<Box sx={anchorSx}>
|
|
59
82
|
{!open && (
|
|
@@ -172,6 +195,8 @@ export function ChatWidget({
|
|
|
172
195
|
border: "3px solid transparent",
|
|
173
196
|
backgroundClip: "content-box",
|
|
174
197
|
},
|
|
198
|
+
overscrollBehavior: "contain",
|
|
199
|
+
WebkitOverflowScrolling: "touch",
|
|
175
200
|
}}
|
|
176
201
|
>
|
|
177
202
|
{msgs.map((m) => {
|