lisichatbot 1.7.4 → 1.7.6
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/index.js +14 -13
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -51,25 +51,26 @@ let flowData = null;
|
|
|
51
51
|
function scrollToBottom() {
|
|
52
52
|
if (!elements.messages) return;
|
|
53
53
|
|
|
54
|
-
// ✅
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
54
|
+
// ✅ Instant scroll to absolute bottom with detailed logging
|
|
55
|
+
const scrollNow = () => {
|
|
56
|
+
const before = elements.messages.scrollTop;
|
|
57
|
+
const height = elements.messages.scrollHeight;
|
|
58
|
+
const clientHeight = elements.messages.clientHeight;
|
|
59
|
+
|
|
60
|
+
elements.messages.scrollTop = elements.messages.scrollHeight;
|
|
61
|
+
|
|
62
|
+
const after = elements.messages.scrollTop;
|
|
63
|
+
console.log(` 📜 Scroll: ${before}px → ${after}px (height: ${height}px, client: ${clientHeight}px, diff: ${height - clientHeight}px)`);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
// Immediate scroll
|
|
67
|
-
|
|
67
|
+
scrollNow();
|
|
68
68
|
|
|
69
|
-
// ✅ Use requestAnimationFrame to
|
|
69
|
+
// ✅ Use requestAnimationFrame to catch any layout changes
|
|
70
70
|
requestAnimationFrame(() => {
|
|
71
|
+
scrollNow();
|
|
71
72
|
requestAnimationFrame(() => {
|
|
72
|
-
|
|
73
|
+
scrollNow();
|
|
73
74
|
});
|
|
74
75
|
});
|
|
75
76
|
}
|