diff --git a/web/ScriptTextInput.vue b/web/ScriptTextInput.vue index c8d1b99..64ad134 100644 --- a/web/ScriptTextInput.vue +++ b/web/ScriptTextInput.vue @@ -78,7 +78,7 @@ const textareaRef = ref(null); // Reactive state const gutterLines = ref(['1']); -const editorHeight = ref('170px'); +const editorHeight = ref('100%'); const scrollTop = ref(0); const scrollLeft = ref(0); const textareaWidth = ref(0); @@ -329,24 +329,9 @@ const refresh = () => { // Apply translation to gutter gutterContent.style.transform = `translateY(${adjustedBaseline - scrollTop.value}px)`; - // Handle height resizing of the editor component - const contentHeight = measureEl.offsetHeight || (lhPx * lineCount); const parent = wrapperRef.value?.parentElement; - const parentHeight = parent ? parent.clientHeight : null; - const minHeight = 170; - let maxHeight = 600; - - if (parentHeight !== null && parentHeight > 0) { - maxHeight = Math.max(minHeight, parentHeight - 12); - } - - const desired = Math.min(Math.max(contentHeight, minHeight), maxHeight); - - // FIX: If containing node is larger than text height (user enlarged the node), fill 100% of parent height - if (parentHeight && parentHeight > desired + 20) { + if (parent && parent.clientHeight > 0) { editorHeight.value = '100%'; - } else { - editorHeight.value = desired + 'px'; } }); }; @@ -470,9 +455,12 @@ watch(modelValue, () => {