mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add rounding to textarea autofit
This commit is contained in:
@@ -702,7 +702,7 @@ const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|||||||
*/
|
*/
|
||||||
function autoFitSendTextArea() {
|
function autoFitSendTextArea() {
|
||||||
const originalScrollBottom = chatBlock.scrollHeight - (chatBlock.scrollTop + chatBlock.offsetHeight);
|
const originalScrollBottom = chatBlock.scrollHeight - (chatBlock.scrollTop + chatBlock.offsetHeight);
|
||||||
if (sendTextArea.scrollHeight + 3 == sendTextArea.offsetHeight) {
|
if (Math.ceil(sendTextArea.scrollHeight + 3) >= Math.floor(sendTextArea.offsetHeight)) {
|
||||||
// Needs to be pulled dynamically because it is affected by font size changes
|
// Needs to be pulled dynamically because it is affected by font size changes
|
||||||
const sendTextAreaMinHeight = window.getComputedStyle(sendTextArea).getPropertyValue('min-height');
|
const sendTextAreaMinHeight = window.getComputedStyle(sendTextArea).getPropertyValue('min-height');
|
||||||
sendTextArea.style.height = sendTextAreaMinHeight;
|
sendTextArea.style.height = sendTextAreaMinHeight;
|
||||||
|
@@ -1112,8 +1112,8 @@ select {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#send_textarea {
|
#send_textarea {
|
||||||
min-height: calc(var(--bottomFormBlockSize) + 3px);
|
min-height: calc(var(--bottomFormBlockSize) + 2px);
|
||||||
height: calc(var(--bottomFormBlockSize) + 3px);
|
height: calc(var(--bottomFormBlockSize) + 2px);
|
||||||
max-height: 50vh;
|
max-height: 50vh;
|
||||||
max-height: 50svh;
|
max-height: 50svh;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
Reference in New Issue
Block a user