mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-31 11:35:37 +01:00
Don't overextend edit textarea height
This commit is contained in:
parent
4895b6def8
commit
e22b18ce80
@ -9232,9 +9232,12 @@ jQuery(async function () {
|
||||
* @param {HTMLTextAreaElement} e Textarea element to auto-fit
|
||||
*/
|
||||
function autoFitEditTextArea(e) {
|
||||
const computedStyle = window.getComputedStyle(e);
|
||||
const maxHeight = parseInt(computedStyle.maxHeight, 10);
|
||||
const newHeight = e.scrollHeight + 4;
|
||||
scroll_holder = chatElement[0].scrollTop;
|
||||
e.style.height = '0';
|
||||
e.style.height = `${e.scrollHeight + 4}px`;
|
||||
e.style.height = computedStyle.minHeight;
|
||||
e.style.height = (newHeight < maxHeight) ? `${newHeight}px` : `${maxHeight}px`;
|
||||
is_use_scroll_holder = true;
|
||||
}
|
||||
const autoFitEditTextAreaDebounced = debouncedThrottle(autoFitEditTextArea, debounce_timeout.short);
|
||||
|
Loading…
x
Reference in New Issue
Block a user