@@ -1049,6 +1049,16 @@ function ReportActionCompose({
1049
1049
runOnJS ( submitForm ) ( ) ;
1050
1050
} ) ;
1051
1051
1052
+ const menuItems = [
1053
+ ...moneyRequestOptions ,
1054
+ ...taskOption ,
1055
+ {
1056
+ icon : Expensicons . Paperclip ,
1057
+ text : translate ( 'reportActionCompose.addAttachment' ) ,
1058
+ onSelected : ( ) => { } ,
1059
+ } ,
1060
+ ] ;
1061
+
1052
1062
return (
1053
1063
< View style = { [ shouldShowReportRecipientLocalTime && ! lodashGet ( network , 'isOffline' ) && styles . chatItemComposeWithFirstRow , isComposerFullSize && styles . chatItemFullComposeRow ] } >
1054
1064
< OfflineWithFeedback
@@ -1130,7 +1140,7 @@ function ReportActionCompose({
1130
1140
1131
1141
// Drop focus to avoid blue focus ring.
1132
1142
actionButton . current . blur ( ) ;
1133
- setMenuVisibility ( true ) ;
1143
+ setMenuVisibility ( ! isMenuVisible ) ;
1134
1144
} }
1135
1145
style = { styles . composerSizeButton }
1136
1146
disabled = { isBlockedFromConcierge || disabled }
@@ -1145,7 +1155,24 @@ function ReportActionCompose({
1145
1155
animationInTiming = { CONST . ANIMATION_IN_TIMING }
1146
1156
isVisible = { isMenuVisible }
1147
1157
onClose = { ( ) => setMenuVisibility ( false ) }
1148
- onItemSelected = { ( ) => setMenuVisibility ( false ) }
1158
+ onItemSelected = { ( _item , index ) => {
1159
+ setMenuVisibility ( false ) ;
1160
+
1161
+ // In order for the file picker to open dynamically, the click
1162
+ // function must be called from within a event handler that was initiated
1163
+ // by the user.
1164
+ if ( index === menuItems . length - 1 ) {
1165
+ // Set a flag to block suggestion calculation until we're finished using the file picker,
1166
+ // which will stop any flickering as the file picker opens on non-native devices.
1167
+ if ( willBlurTextInputOnTapOutside ) {
1168
+ shouldBlockEmojiCalc . current = true ;
1169
+ shouldBlockMentionCalc . current = true ;
1170
+ }
1171
+ openPicker ( {
1172
+ onPicked : displayFileInModal ,
1173
+ } ) ;
1174
+ }
1175
+ } }
1149
1176
anchorPosition = { styles . createMenuPositionReportActionCompose ( windowHeight ) }
1150
1177
anchorAlignment = { { horizontal : CONST . MODAL . ANCHOR_ORIGIN_HORIZONTAL . LEFT , vertical : CONST . MODAL . ANCHOR_ORIGIN_VERTICAL . BOTTOM } }
1151
1178
menuItems = { [
@@ -1168,6 +1195,8 @@ function ReportActionCompose({
1168
1195
} ,
1169
1196
} ,
1170
1197
] }
1198
+ withoutOverlay
1199
+ anchorRef = { actionButton }
1171
1200
/>
1172
1201
</ >
1173
1202
) }
0 commit comments