Michael Siebenmann commited on
Commit
151ba7d
Β·
1 Parent(s): e128d96

improve chat input textarea

Browse files

remove default scrollbar and resize back to normal after submit

Files changed (2) hide show
  1. static/map.js +14 -1
  2. static/style.css +5 -0
static/map.js CHANGED
@@ -157,7 +157,20 @@
157
  }
158
  setTimeout(buildImageLightbox, 700);
159
 
160
- /* ── 6. Info modal & dark-mode toggle (mobile footer) ── */
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  function initFooterBtns() {
162
  var infoBtn = document.getElementById('footer-info-btn');
163
  var backdrop = document.getElementById('info-modal-backdrop');
 
157
  }
158
  setTimeout(buildImageLightbox, 700);
159
 
160
+ /* ── 6. Reset textarea height after submit clears the input ── */
161
+ function initTextareaReset() {
162
+ var chatCol = document.getElementById('chat-col-inner');
163
+ if (!chatCol) { setTimeout(initTextareaReset, 400); return; }
164
+ new MutationObserver(function () {
165
+ var ta = chatCol.querySelector('.multimodal-textbox textarea');
166
+ if (ta && !ta.value && ta.style.height) {
167
+ ta.style.height = '';
168
+ }
169
+ }).observe(chatCol, { childList: true, subtree: true, characterData: true });
170
+ }
171
+ setTimeout(initTextareaReset, 500);
172
+
173
+ /* ── 7. Info modal & dark-mode toggle (mobile footer) ── */
174
  function initFooterBtns() {
175
  var infoBtn = document.getElementById('footer-info-btn');
176
  var backdrop = document.getElementById('info-modal-backdrop');
static/style.css CHANGED
@@ -424,3 +424,8 @@ body.chat-active .title-small {
424
  cursor: zoom-in;
425
  }
426
 
 
 
 
 
 
 
424
  cursor: zoom-in;
425
  }
426
 
427
+ /* Hide Chrome's default scrollbar arrows on the chat input textarea */
428
+ .multimodal-textbox textarea {
429
+ overflow-y: auto !important;
430
+ }
431
+