File tree 2 files changed +8
-1
lines changed
libs/focusComposerWithDelay
pages/home/report/ReportActionCompose
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ function focusComposerWithDelay(textInput: InputType | null): FocusComposerWithD
31
31
if ( ! textInput ) {
32
32
return ;
33
33
}
34
- textInput . focus ( ) ;
34
+ // When the closing modal has a focused text input focus() needs a delay to properly work.
35
+ setTimeout ( ( ) => textInput . focus ( ) , 0 ) ;
35
36
if ( forcedSelectionRange ) {
36
37
setTextInputSelection ( textInput , forcedSelectionRange ) ;
37
38
}
Original file line number Diff line number Diff line change @@ -462,6 +462,12 @@ function ReportActionCompose({
462
462
raiseIsScrollLikelyLayoutTriggered = { raiseIsScrollLikelyLayoutTriggered }
463
463
onAddActionPressed = { onAddActionPressed }
464
464
onItemSelected = { onItemSelected }
465
+ onCanceledAttachmentPicker = { ( ) => {
466
+ if ( ! shouldFocusInputOnScreenFocus ) {
467
+ return ;
468
+ }
469
+ focus ( ) ;
470
+ } }
465
471
actionButtonRef = { actionButtonRef }
466
472
shouldDisableAttachmentItem = { hasExceededMaxCommentLength }
467
473
/>
You can’t perform that action at this time.
0 commit comments