Skip to content

Commit

Permalink
Merge pull request #32598 from s-alves10/fix/issue-32218
Browse files Browse the repository at this point in the history
fix: change onyxFocused state on umount instead of deleteDraft
  • Loading branch information
tylerkaraszewski authored Dec 19, 2023
2 parents 25745d0 + 7dee80b commit 0430482
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/home/report/ReportActionItemMessageEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ function ReportActionItemMessageEdit(props) {
}

return () => {
InputFocus.callback(() => setIsFocused(false));
InputFocus.inputFocusChange(false);

// Skip if the current report action is not active
if (!isActive()) {
return;
Expand Down Expand Up @@ -288,8 +291,6 @@ function ReportActionItemMessageEdit(props) {
* Delete the draft of the comment being edited. This will take the comment out of "edit mode" with the old content.
*/
const deleteDraft = useCallback(() => {
InputFocus.callback(() => setIsFocused(false));
InputFocus.inputFocusChange(false);
debouncedSaveDraft.cancel();
Report.saveReportActionDraft(props.reportID, props.action, '');

Expand Down

0 comments on commit 0430482

Please sign in to comment.