File tree Expand file tree Collapse file tree
ggsql-wasm/demo/src/quarto Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,15 +176,8 @@ export interface EditorInstance {
176176 editor : monaco . editor . IStandaloneCodeEditor ;
177177}
178178
179- const LINE_HEIGHT = 20 ;
180179const PADDING_TOP = 8 ;
181180const PADDING_BOTTOM = 8 ;
182- const MAX_EDITOR_HEIGHT = 400 ;
183-
184- function editorHeight ( lineCount : number ) : number {
185- const contentHeight = lineCount * LINE_HEIGHT + PADDING_TOP + PADDING_BOTTOM ;
186- return Math . min ( contentHeight , MAX_EDITOR_HEIGHT ) ;
187- }
188181
189182export async function createEditor (
190183 container : HTMLElement ,
@@ -193,9 +186,6 @@ export async function createEditor(
193186) : Promise < EditorInstance > {
194187 await ensureLanguageRegistered ( siteRoot ) ;
195188
196- const lineCount = initialValue . split ( "\n" ) . length ;
197- container . style . height = editorHeight ( lineCount ) + "px" ;
198-
199189 const editor = monaco . editor . create ( container , {
200190 value : initialValue ,
201191 language : "ggsql" ,
@@ -224,8 +214,8 @@ export async function createEditor(
224214
225215 // Auto-resize editor height to content
226216 editor . onDidContentSizeChange ( ( ) => {
227- const newLineCount = editor . getModel ( ) ?. getLineCount ( ) || lineCount ;
228- container . style . height = editorHeight ( newLineCount ) + "px" ;
217+ const contentHeight = editor . getContentHeight ( ) ;
218+ container . style . height = contentHeight + "px" ;
229219 editor . layout ( ) ;
230220 } ) ;
231221
Original file line number Diff line number Diff line change 2929 display : none;
3030}
3131
32+ .ggsql-editor-wrapper .monaco-editor .overflow-guard {
33+ touch-action : pan-y !important ;
34+ }
35+
3236.ggsql-error-display .visible {
3337 display : block;
3438}
You can’t perform that action at this time.
0 commit comments