Limit edit textarea height to 75%

This commit is contained in:
Cohee 2024-07-12 21:39:32 +03:00
parent 63ddb81ef7
commit 0a0fc0141c
2 changed files with 4 additions and 1 deletions

View File

@ -9242,7 +9242,8 @@ jQuery(async function () {
const autoFitEditTextAreaDebounced = debounce(autoFitEditTextArea, debounce_timeout.short);
document.addEventListener('input', e => {
if (e.target instanceof HTMLTextAreaElement && e.target.classList.contains('edit_textarea')) {
const immediately = e.target.scrollHeight > e.target.offsetHeight || e.target.value === '';
const scrollbarShown = e.target.clientWidth < e.target.offsetWidth && e.target.offsetHeight >= window.innerHeight * 0.75;
const immediately = (e.target.scrollHeight > e.target.offsetHeight && !scrollbarShown) || e.target.value === '';
immediately ? autoFitEditTextArea(e.target) : autoFitEditTextAreaDebounced(e.target);
}
});

View File

@ -3910,6 +3910,8 @@ input[type="range"]::-webkit-slider-thumb {
outline: none;
background-color: var(--black50a);
line-height: calc(var(--mainFontSize) + .25rem);
max-height: 75vh;
max-height: 75dvh;
}
#anchor_order {