Skip to content

Commit

Permalink
Merge pull request #36300 from jeremy-croff/fix(35835)
Browse files Browse the repository at this point in the history
Fix(35835)
  • Loading branch information
NikkiWines authored Feb 21, 2024
2 parents 6b82cfd + 28f9afd commit c1e73ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/libs/setShouldShowComposeInputKeyboardAware/index.ios.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import setShouldShowComposeInputKeyboardAwareBuilder from './setShouldShowComposeInputKeyboardAwareBuilder';

// On iOS, there is a visible delay in displaying input after the keyboard has been closed with the `keyboardDidHide` event
// Because of that - on iOS we can use `keyboardWillHide` that is not available on android
export default setShouldShowComposeInputKeyboardAwareBuilder('keyboardWillHide');
export default setShouldShowComposeInputKeyboardAwareBuilder('keyboardDidHide');
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import * as Composer from '@userActions/Composer';
import type SetShouldShowComposeInputKeyboardAware from './types';

let keyboardEventListener: EmitterSubscription | null = null;
// On iOS, there is a visible delay in displaying input after the keyboard has been closed with the `keyboardDidHide` event
// Because of that - on iOS we can use `keyboardWillHide` that is not available on android

const setShouldShowComposeInputKeyboardAwareBuilder: (keyboardEvent: KeyboardEventName) => SetShouldShowComposeInputKeyboardAware =
(keyboardEvent: KeyboardEventName) => (shouldShow: boolean) => {
Expand Down
4 changes: 4 additions & 0 deletions src/pages/home/report/ReportActionItemMessageEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManag
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
import * as ReportUtils from '@libs/ReportUtils';
import setShouldShowComposeInputKeyboardAware from '@libs/setShouldShowComposeInputKeyboardAware';
import * as ComposerActions from '@userActions/Composer';
import * as EmojiPickerAction from '@userActions/EmojiPickerAction';
import * as InputFocus from '@userActions/InputFocus';
import * as Report from '@userActions/Report';
Expand Down Expand Up @@ -211,6 +212,9 @@ function ReportActionItemMessageEdit(
// eslint-disable-next-line react-hooks/exhaustive-deps -- this cleanup needs to be called only on unmount
}, [action.reportActionID]);

// show the composer after editing is complete for devices that hide the composer during editing.
useEffect(() => () => ComposerActions.setShouldShowComposeInput(true), []);

/**
* Save the draft of the comment. This debounced so that we're not ceaselessly saving your edit. Saving the draft
* allows one to navigate somewhere else and come back to the comment and still have it in edit mode.
Expand Down

0 comments on commit c1e73ec

Please sign in to comment.