@@ -59,6 +59,7 @@ import type { ESQLEditorProps, ESQLEditorDeps, ControlsContext } from './types';
5959
6060// for editor width smaller than this value we want to start hiding some text
6161const BREAKPOINT_WIDTH = 540 ;
62+ const DATEPICKER_WIDTH = 373 ;
6263
6364const triggerControl = async (
6465 queryString : string ,
@@ -255,8 +256,12 @@ export const ESQLEditor = memo(function ESQLEditor({
255256 const editorLeft = editorCoords . left ;
256257
257258 // Calculate the absolute position of the popover
258- const absoluteTop = editorTop + ( editorPosition ?. top ?? 0 ) + 20 ;
259- const absoluteLeft = editorLeft + ( editorPosition ?. left ?? 0 ) ;
259+ const absoluteTop = editorTop + ( editorPosition ?. top ?? 0 ) + 25 ;
260+ let absoluteLeft = editorLeft + ( editorPosition ?. left ?? 0 ) ;
261+ if ( absoluteLeft > editorCoords . width ) {
262+ // date picker is out of the editor
263+ absoluteLeft = absoluteLeft - DATEPICKER_WIDTH ;
264+ }
260265
261266 setPopoverPosition ( { top : absoluteTop , left : absoluteLeft } ) ;
262267 datePickerOpenStatusRef . current = true ;
@@ -887,6 +892,8 @@ export const ESQLEditor = memo(function ESQLEditor({
887892 borderRadius : theme . euiTheme . border . radius . small ,
888893 position : 'absolute' ,
889894 overflow : 'auto' ,
895+ zIndex : 1001 ,
896+ border : theme . euiTheme . border . thin ,
890897 } }
891898 ref = { popoverRef }
892899 data-test-subj = "ESQLEditor-timepicker-popover"
0 commit comments