Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(35835) #36300

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines -3 to -4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing this comment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see the reason now. NVM my comment.

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 @@ -30,6 +30,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 @@ -210,6 +211,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
Loading