fix: A2UI now behaves better

This commit is contained in:
2026-05-01 23:15:04 +02:00
parent 64a5eb525d
commit c495a2ed0a
7 changed files with 163 additions and 12 deletions

View File

@@ -788,6 +788,10 @@ document.addEventListener("DOMContentLoaded", () => {
});
};
this.surfaceObserver = new MutationObserver(() => {
this.syncExpandedSurfaces();
});
this.handleScroll = () => {
if (!this.scrollContainer) {
this.stickToBottom = true;
@@ -832,6 +836,7 @@ document.addEventListener("DOMContentLoaded", () => {
this.syncScrollContainer();
this.syncExpandedSurfaces();
this.surfaceObserver.observe(this.el, { childList: true, subtree: true });
this.autoResize();
window.requestAnimationFrame(() => this.scrollToBottom(true));
},
@@ -844,6 +849,7 @@ document.addEventListener("DOMContentLoaded", () => {
},
destroyed() {
this.surfaceObserver.disconnect();
this.el.removeEventListener("input", this.handleInput);
this.el.removeEventListener("keydown", this.handleKeyDown);