Constrain size of prompt textarea fix #172
This commit is contained in:
		
							parent
							
								
									91ff59d9ba
								
							
						
					
					
						commit
						d96b38e8ea
					
				| 
						 | 
				
			
			@ -245,8 +245,6 @@ $modal-background-background-color-dark: rgba($dark, 0.86) !default; // remove t
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Loading chat messages */
 | 
			
		||||
.is-loading {
 | 
			
		||||
  opacity: 0.5;
 | 
			
		||||
| 
						 | 
				
			
			@ -462,6 +460,10 @@ aside.menu.main-menu .menu-expanse {
 | 
			
		|||
  .control.send .button {
 | 
			
		||||
    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) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,6 +21,13 @@
 | 
			
		|||
    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.
 | 
			
		||||
    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
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue