@@ -142,14 +142,17 @@ export class FieldDate extends Blockly.FieldTextInput {
142142 if ( ! this . htmlInput_ ) return ;
143143 Blockly . utils . dom . addClass ( this . htmlInput_ , 'blocklyDateInput' ) ;
144144
145- // NOTE: HTMLInputElement.showPicker() is not available in earlier
146- // TypeScript versions (like 4.7.4), so casting to `any` to be compatible
147- // with dev scripts. Additionally, it's not available for date inputs for
148- // Safari. For browser compatibility of showPicker, see:
149- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/showPicker
150- /* eslint-disable @typescript-eslint/no-explicit-any */
151- ( this . htmlInput_ as any ) . showPicker ( ) ;
152- /* eslint-enable @typescript-eslint/no-explicit-any */
145+ // Delay showing the picker until the editor has a chance to position
146+ window . requestAnimationFrame ( ( ) => {
147+ // NOTE: HTMLInputElement.showPicker() is not available in earlier
148+ // TypeScript versions (like 4.7.4), so casting to `any` to be compatible
149+ // with dev scripts. Additionally, it's not available for date inputs for
150+ // Safari. For browser compatibility of showPicker, see:
151+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/showPicker
152+ /* eslint-disable @typescript-eslint/no-explicit-any */
153+ ( this . htmlInput_ as any ) . showPicker ( ) ;
154+ /* eslint-enable @typescript-eslint/no-explicit-any */
155+ } ) ;
153156 }
154157
155158 /**
0 commit comments