sync update from LAN repo (source dhk-1 @ 3b1ec5b4)
This commit is contained in:
1 parent
da6521b6cb
commit
264e2200d6
995 files changed
+148105
-13399
No files matched your search
@@ -998,11 +998,24 @@ export const PromptInputTextarea = ({
|
||||
|
||||
// Chrome 109 ignores field-sizing: content. Preserve the same 4rem–12rem
|
||||
// autosize range used by min-h-16/max-h-48 instead of leaving the prompt
|
||||
// stuck at its minimum height.
|
||||
// stuck at its minimum height. A custom appearance height replaces that range.
|
||||
let minBound = 64;
|
||||
let maxBound = 192;
|
||||
if (textarea.hasAttribute("data-composer-height")) {
|
||||
const computed = window.getComputedStyle(textarea);
|
||||
const minHeight = Number.parseFloat(computed.minHeight);
|
||||
const maxHeight = Number.parseFloat(computed.maxHeight);
|
||||
if (Number.isFinite(minHeight)) minBound = minHeight;
|
||||
if (Number.isFinite(maxHeight)) maxBound = maxHeight;
|
||||
}
|
||||
textarea.style.height = "auto";
|
||||
const height = Math.max(64, Math.min(textarea.scrollHeight, 192));
|
||||
const height = Math.max(
|
||||
minBound,
|
||||
Math.min(textarea.scrollHeight, maxBound),
|
||||
);
|
||||
textarea.style.height = `${height}px`;
|
||||
textarea.style.overflowY = textarea.scrollHeight > 192 ? "auto" : "hidden";
|
||||
textarea.style.overflowY =
|
||||
textarea.scrollHeight > maxBound ? "auto" : "hidden";
|
||||
}, []);
|
||||
|
||||
// onInput does not run for a controlled value filled by a suggested question
|
||||
|
||||
Reference in new issue
Block a user