lisichatbot 1.7.4 → 1.7.5
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 +3 -21
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -51,27 +51,9 @@ let flowData = null;
|
|
|
51
51
|
function scrollToBottom() {
|
|
52
52
|
if (!elements.messages) return;
|
|
53
53
|
|
|
54
|
-
// ✅
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (lastChild) {
|
|
58
|
-
lastChild.scrollIntoView({ behavior: 'smooth', block: 'end', inline: 'nearest' });
|
|
59
|
-
console.log(` 📜 Scrolled last element into view`);
|
|
60
|
-
} else {
|
|
61
|
-
// Fallback to scrollHeight
|
|
62
|
-
elements.messages.scrollTop = elements.messages.scrollHeight;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// Immediate scroll
|
|
67
|
-
scrollToLastElement();
|
|
68
|
-
|
|
69
|
-
// ✅ Use requestAnimationFrame to ensure DOM layout is complete
|
|
70
|
-
requestAnimationFrame(() => {
|
|
71
|
-
requestAnimationFrame(() => {
|
|
72
|
-
scrollToLastElement();
|
|
73
|
-
});
|
|
74
|
-
});
|
|
54
|
+
// ✅ Scroll to absolute bottom instantly (no smooth animation)
|
|
55
|
+
elements.messages.scrollTop = elements.messages.scrollHeight;
|
|
56
|
+
console.log(` 📜 Scrolled to bottom: ${elements.messages.scrollHeight}px`);
|
|
75
57
|
}
|
|
76
58
|
|
|
77
59
|
function enableNextButton() {
|