-
Notifications
You must be signed in to change notification settings - Fork 215
fix(surveys): android keyboard glitching #2809
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
954fe44 to
47fd005
Compare
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.
2 files reviewed, 1 comment
| behavior={Platform.OS === 'ios' ? 'padding' : 'height'} | ||
| behavior={Platform.OS === 'ios' ? 'padding' : androidKeyboardBehavior} | ||
| style={{ flex: 1, justifyContent: 'flex-end' }} | ||
| keyboardVerticalOffset={Platform.OS === 'ios' ? 10 : 0} |
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.
style: keyboardVerticalOffset hardcoded to 0 for Android. When using 'padding' behavior, a non-zero offset may be needed for proper spacing (similar to iOS). Consider making this configurable or using a conditional offset based on the behavior type.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/react-native/src/surveys/components/SurveyModal.tsx
Line: 45:45
Comment:
**style:** `keyboardVerticalOffset` hardcoded to 0 for Android. When using `'padding'` behavior, a non-zero offset may be needed for proper spacing (similar to iOS). Consider making this configurable or using a conditional offset based on the behavior type.
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.|
Size Change: +207 B (0%) Total Size: 5.33 MB
ℹ️ View Unchanged
|
ioannisj
left a comment
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.
Approved to unblock you and the customer. Would prefer though we validate with them that this will work first since it seems we've been deliberately setting height before
| return ( | ||
| <Modal animationType="fade" transparent onRequestClose={onClose} statusBarTranslucent={true}> | ||
| <KeyboardAvoidingView | ||
| behavior={Platform.OS === 'ios' ? 'padding' : 'height'} |
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 like we were deliberately setting height for Android. Wonder what the original reason was but @marandaneto is OOO
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.
yeah good question, i was trying to find out but didn't get very far
as far as i can tell it's always been like that, and i think the bug we are seeing is related to this facebook/react-native#45192, but still not 100% sure
i asked the customer if they'd be able to pull our branch for testing so i can hang tight on merging until i hear back from her on that
Problem
the keyboard causes major glitching in some cases on android. customer video here: https://posthoghelp.zendesk.com/agent/tickets/44614
reproduction here, on android 16 with physical keyboard + stylus input modes enabled:
Screen Recording 2025-12-22 at 12.53.23 PM.mov (uploaded via Graphite)
Changes
adds a new sdk param
androidKeyboardBehaviorto control the behavior forKeyboardAvoidingViewon androidsetting it to
paddingresolved the issue in my testing, but i do not want to risk a regression hereRelease info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file