mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-12 10:00:36 +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
|
* @param {HTMLTextAreaElement} e Textarea element to auto-fit
|
||||||
*/
|
*/
|
||||||
function autoFitEditTextArea(e) {
|
function autoFitEditTextArea(e) {
|
||||||
|
const computedStyle = window.getComputedStyle(e);
|
||||||
|
const maxHeight = parseInt(computedStyle.maxHeight, 10);
|
||||||
|
const newHeight = e.scrollHeight + 4;
|
||||||
scroll_holder = chatElement[0].scrollTop;
|
scroll_holder = chatElement[0].scrollTop;
|
||||||
e.style.height = '0';
|
e.style.height = computedStyle.minHeight;
|
||||||
e.style.height = `${e.scrollHeight + 4}px`;
|
e.style.height = (newHeight < maxHeight) ? `${newHeight}px` : `${maxHeight}px`;
|
||||||
is_use_scroll_holder = true;
|
is_use_scroll_holder = true;
|
||||||
}
|
}
|
||||||
const autoFitEditTextAreaDebounced = debouncedThrottle(autoFitEditTextArea, debounce_timeout.short);
|
const autoFitEditTextAreaDebounced = debouncedThrottle(autoFitEditTextArea, debounce_timeout.short);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user