-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Extra keyboard #8348
Extra keyboard #8348
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Android and iPhone, looks good to me! Thanks @enahum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great. Just a few comments.
app/context/extra_keyboard/index.tsx
Outdated
const registerTextInputFocus = useCallback(() => { | ||
setIsTextInputFocused(true); | ||
setTimeout(() => { | ||
setExtraKeyboardVisible(false); | ||
}, 400); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't completely understand why the extra keyboard sets visible to false when the input is focused. Is it a mistake, or I am missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah.. yes this one is tricky.. in short is a hack to handle the fact that the Android Keyboard when receiving focus will cause an animation glitch if the extra keyboard was already opened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is one is tricky, I think we should add some comment to explain why we do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart of the comment on my previous review about adding a comment to the tricky behavior, LGTM.
This also fixes https://mattermost.atlassian.net/browse/MM-61917 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Summary
This PR removes the KeyboardTrackingView used to track the keyboard on the post list for iOS as well as adds functionality to change the adjust behavior on Android.
With the two above taken care of, now our app will no longer move the contents of the screen (aka post list) on both Android and iOS when giving focus to the draft input. Instead we are adding a View below the draft input that will animate its height to the keyboard height, moving the contents of the screen upwards (this works fine even when using a hardware keyboard).
Additionally, we have the ability to set a custom component where the keyboard is displayed to accommodate for things like the emoji picker and in the future if we want the image picker and others.
Ticket Link
https://mattermost.atlassian.net/browse/MM-61739
https://mattermost.atlassian.net/browse/MM-61551
https://mattermost.atlassian.net/browse/MM-61917
Checklist
Device Information
This PR was tested on:
iPhone 14
iPhone SE
iPhone 16 Pro
iPad 11
iPad 13 Max
Emulators for Android 14 and 15 including foldable devices
Release Note