File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,8 @@ const QueueCommands: React.FC<QueueCommandsProps> = ({
400
400
/>
401
401
) ;
402
402
403
- // Use setTimeout to ensure the component has rendered
403
+ // Use a small delay to ensure the component has rendered
404
+ // 50ms is generally enough for React to complete a render cycle
404
405
setTimeout ( ( ) => {
405
406
// Extract options from the rendered select element
406
407
const selectElement = hiddenRenderContainer . querySelector ( 'select' ) ;
@@ -420,7 +421,7 @@ const QueueCommands: React.FC<QueueCommandsProps> = ({
420
421
// Clean up
421
422
root . unmount ( ) ;
422
423
document . body . removeChild ( hiddenRenderContainer ) ;
423
- } , 0 ) ;
424
+ } , 50 ) ; // Increased timeout to ensure render completes
424
425
} }
425
426
tabIndex = { 0 }
426
427
onKeyDown = { ( e ) => {
@@ -442,7 +443,8 @@ const QueueCommands: React.FC<QueueCommandsProps> = ({
442
443
/>
443
444
) ;
444
445
445
- // Use setTimeout to ensure the component has rendered
446
+ // Use a small delay to ensure the component has rendered
447
+ // 50ms is generally enough for React to complete a render cycle
446
448
setTimeout ( ( ) => {
447
449
// Extract options from the rendered select element
448
450
const selectElement = hiddenRenderContainer . querySelector ( 'select' ) ;
@@ -471,7 +473,7 @@ const QueueCommands: React.FC<QueueCommandsProps> = ({
471
473
// Clean up
472
474
root . unmount ( ) ;
473
475
document . body . removeChild ( hiddenRenderContainer ) ;
474
- } , 0 ) ;
476
+ } , 50 ) ; // Increased timeout to ensure render completes
475
477
}
476
478
} }
477
479
>
You can’t perform that action at this time.
0 commit comments