Constrain size of prompt textarea fix #172

This commit is contained in:
Webifi 2023-06-13 21:54:11 -05:00
parent 91ff59d9ba
commit d96b38e8ea
2 changed files with 11 additions and 2 deletions

View File

@ -245,8 +245,6 @@ $modal-background-background-color-dark: rgba($dark, 0.86) !default; // remove t
} }
} }
/* Loading chat messages */ /* Loading chat messages */
.is-loading { .is-loading {
opacity: 0.5; opacity: 0.5;
@ -462,6 +460,10 @@ aside.menu.main-menu .menu-expanse {
.control.send .button { .control.send .button {
width: 60px; width: 60px;
} }
textarea {
max-height: calc(100vh - (var(--chatContentPaddingBottom) + var(--runningTotalLineHeight) * var(--running-totals))) !important;
min-height: 38px !important;
}
} }
@media only screen and (max-width: 768px) { @media only screen and (max-width: 768px) {

View File

@ -21,6 +21,13 @@
const anyEl = el as any // Oh how I hate typescript. All the markup of Java with no real payoff.. const anyEl = el as any // Oh how I hate typescript. All the markup of Java with no real payoff..
if (!anyEl.__didAutoGrow) el.style.height = '38px' // don't use "auto" here. Firefox will over-size. if (!anyEl.__didAutoGrow) el.style.height = '38px' // don't use "auto" here. Firefox will over-size.
el.style.height = el.scrollHeight + 'px' el.style.height = el.scrollHeight + 'px'
setTimeout(() => {
if (el.scrollHeight > el.getBoundingClientRect().height + 5) {
el.style.overflowY = 'auto'
} else {
el.style.overflowY = ''
}
}, 0)
anyEl.__didAutoGrow = true // don't resize this one again unless it's via an event anyEl.__didAutoGrow = true // don't resize this one again unless it's via an event
} }