Skip to content

fix: keyboard transition issue when switching from attachment picker to keyboard#2404

Merged
khushal87 merged 2 commits into
developfrom
attachment-picker-keyboard-issue
Jan 31, 2024
Merged

fix: keyboard transition issue when switching from attachment picker to keyboard#2404
khushal87 merged 2 commits into
developfrom
attachment-picker-keyboard-issue

Conversation

@khushal87
Copy link
Copy Markdown
Contributor

🎯 Goal

Fixes #2024

Before:

Screen.Recording.2024-01-22.at.11.55.09.PM.mov

After:

Screen.Recording.2024-01-23.at.12.03.23.PM.mov

🛠 Implementation details

🎨 UI Changes

iOS
Before After
Android
Before After

🧪 Testing

☑️ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

@khushal87 khushal87 requested a review from santhoshvai January 23, 2024 07:35
@@ -193,7 +199,7 @@ export const AttachmentPicker = React.forwardRef(
// To keep compatibility with older versions of React Native, where `remove()` is not available
Keyboard.removeListener(keyboardShowEvent, closePicker);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Keyboard.removeListener(keyboardShowEvent, closePicker);
Keyboard.removeListener(keyboardShowEvent, onKeyboardOpenHandler);

Comment on lines +185 to +187
if (selectedPicker) {
setSelectedPicker(undefined);
}
Copy link
Copy Markdown
Member

@santhoshvai santhoshvai Jan 26, 2024

Choose a reason for hiding this comment

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

cant this be done like this without if?

setSelectedPicker(undefined)

there is no need for an if at all.. if you want it to set it to undefined whenever keyboard is open

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ideally, it won't create much of a difference. Its just a sanity check that we set it as undefined only when there is a value in the selectedPicker state. The same is done for the back action handler in the file.

Copy link
Copy Markdown
Member

@santhoshvai santhoshvai left a comment

Choose a reason for hiding this comment

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

please see comments

@khushal87 khushal87 merged commit 965691f into develop Jan 31, 2024
@khushal87 khushal87 deleted the attachment-picker-keyboard-issue branch January 31, 2024 07:16
@github-actions github-actions Bot mentioned this pull request Jan 31, 2024
6 tasks
@stream-ci-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.24.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keyboard transition broken

3 participants