Skip to content

Commit c0c64ed

Browse files
authored
Merge pull request #62071 from bernhardoj/fix/61292-wrong-cursor-after-close-emoji-picker
Fix wrong cursor after close emoji picker
2 parents 625a197 + 64629fa commit c0c64ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/pages/home/report/ReportActionItemMessageEdit.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function ReportActionItemMessageEdit(
8585
{action, draftMessage, reportID, policyID, index, isGroupPolicyReport, shouldDisableEmojiPicker = false}: ReportActionItemMessageEditProps,
8686
forwardedRef: ForwardedRef<TextInput | HTMLTextAreaElement | undefined>,
8787
) {
88-
const [preferredSkinTone] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {initialValue: CONST.EMOJI_DEFAULT_SKIN_TONE});
88+
const [preferredSkinTone] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {initialValue: CONST.EMOJI_DEFAULT_SKIN_TONE, canBeMissing: true});
8989
const theme = useTheme();
9090
const styles = useThemeStyles();
9191
const StyleUtils = useStyleUtils();
@@ -116,8 +116,8 @@ function ReportActionItemMessageEdit(
116116
willAlertModalBecomeVisible: false,
117117
isVisible: false,
118118
},
119-
] = useOnyx(ONYXKEYS.MODAL);
120-
const [onyxInputFocused = false] = useOnyx(ONYXKEYS.INPUT_FOCUSED);
119+
] = useOnyx(ONYXKEYS.MODAL, {canBeMissing: true});
120+
const [onyxInputFocused = false] = useOnyx(ONYXKEYS.INPUT_FOCUSED, {canBeMissing: true});
121121

122122
const textInputRef = useRef<(HTMLTextAreaElement & TextInput) | null>(null);
123123
const isFocusedRef = useRef<boolean>(false);
@@ -176,6 +176,7 @@ function ReportActionItemMessageEdit(
176176
const setUpComposeFocusManager = useCallback(() => {
177177
ReportActionComposeFocusManager.onComposerFocus(() => {
178178
focus(true, emojiPickerSelectionRef.current ? {...emojiPickerSelectionRef.current} : undefined);
179+
emojiPickerSelectionRef.current = undefined;
179180
}, true);
180181
}, [focus]);
181182

0 commit comments

Comments
 (0)