@@ -129,14 +129,16 @@ type SQLInlineEditorProps = {
129129
130130const MAX_EDITOR_HEIGHT = '150px' ;
131131
132- const createStyleTheme = ( allowMultiline : boolean = false ) =>
132+ const createStyleTheme = ( ) =>
133133 EditorView . baseTheme ( {
134134 '&.cm-editor.cm-focused' : {
135135 outline : '0px solid transparent' ,
136136 } ,
137137 '&.cm-editor' : {
138138 background : 'transparent !important' ,
139- ...( allowMultiline && { maxHeight : MAX_EDITOR_HEIGHT } ) ,
139+ } ,
140+ '.cm-editor-multiline &.cm-editor' : {
141+ maxHeight : MAX_EDITOR_HEIGHT ,
140142 } ,
141143 '& .cm-tooltip-autocomplete' : {
142144 whiteSpace : 'nowrap' ,
@@ -185,10 +187,10 @@ const createStyleTheme = (allowMultiline: boolean = false) =>
185187 } ,
186188 '& .cm-scroller' : {
187189 overflowX : 'hidden' ,
188- ... ( allowMultiline && {
189- maxHeight : MAX_EDITOR_HEIGHT ,
190- overflowY : 'auto' ,
191- } ) ,
190+ } ,
191+ '.cm-editor-multiline & .cm-scroller' : {
192+ maxHeight : MAX_EDITOR_HEIGHT ,
193+ overflowY : 'auto' ,
192194 } ,
193195 } ) ;
194196
@@ -365,7 +367,7 @@ export default function SQLInlineEditor({
365367 const cmExtensions = useMemo (
366368 ( ) => [
367369 ...tooltipExt ,
368- createStyleTheme ( allowMultiline ) ,
370+ createStyleTheme ( ) ,
369371 ...( allowMultiline ? [ EditorView . lineWrapping ] : [ ] ) ,
370372 compartmentRef . current . of (
371373 sql ( {
@@ -441,7 +443,10 @@ export default function SQLInlineEditor({
441443 </ Tooltip >
442444 </ Text >
443445 ) }
444- < div style = { { minWidth : 10 , width : '100%' } } >
446+ < div
447+ style = { { minWidth : 10 , width : '100%' } }
448+ className = { allowMultiline ? 'cm-editor-multiline' : '' }
449+ >
445450 < CodeMirror
446451 indentWithTab = { false }
447452 ref = { ref }
0 commit comments