-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix keyboard overlap on Android when SoftInput.AdjustResize is set #32405
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
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
|
|
||
| [Test] | ||
| [Category(UITestCategories.SafeAreaEdges)] | ||
| public void VerifyKeyboardDoesNotOverlapEntryWithAdjustResize() |
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.
Add a test for AdjustPan Mode. Current test validates AdjustResize; adding a pan-mode assertion ensures no regressions where pan doesn't apply insets incorrectly.
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.
Added AdjustPan test in commit ff901a2. The new test verifies that when SoftInput.AdjustPan is set, no keyboard insets are applied (the window pans instead).
|
@copilot , Add a test for AdjustPan Mode. Current test validates AdjustResize; adding a pan-mode assertion ensures no regressions where pan doesn't apply insets incorrectly. |
Added AdjustPan test in commit ff901a2. Created Issue32041AdjustPan test page and test case that verifies no insets are applied when AdjustPan mode is set. |
c036163 to
c004621
Compare
jsuarezruiz
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.
@copilot Fix current conflict.
|
/rebase |
- Modified SafeAreaExtensions to detect window's SoftInputMode - Apply keyboard insets when AdjustResize is set, even without SoftInput flag - This restores the pre-regression behavior where content resizes to avoid keyboard Co-authored-by: PureWeen <[email protected]>
- Created Issue32041.xaml test page with Entry at bottom - Created Issue32041.xaml.cs that sets SoftInput.AdjustResize - Created Issue32041.cs test that verifies keyboard doesn't overlap Entry Co-authored-by: PureWeen <[email protected]>
Co-authored-by: PureWeen <[email protected]>
Apply code review feedback to use HasFlag instead of manual bitwise comparison Co-authored-by: PureWeen <[email protected]>
- Created Issue32041AdjustPan.xaml and code-behind for AdjustPan test - Added VerifyAdjustPanDoesNotApplyInsets test to ensure no regression - Verifies that with AdjustPan mode, no keyboard insets are applied Co-authored-by: NirmalKumarYuvaraj <[email protected]>
e93315f to
756a5f5
Compare
|
@copilot i have rebased this pr can you asses if your changes on this pr still seem correct? |
Yes, the changes are still correct after the rebase. I've verified: ✅ Core logic intact: SafeAreaExtensions.cs properly detects ✅ Tests preserved: Both test pages (Issue32041 and Issue32041AdjustPan) and test cases exist and are properly structured ✅ Build successful: Core Android project builds without errors ✅ Unit tests passing: All 45 SafeArea unit tests pass ✅ 6 commits intact:
The fix correctly restores .NET 9 behavior by applying keyboard insets when users set |
Summary
Fixed Issue #32041 where keyboard overlaps Entry controls when
SoftInput.AdjustResizeis set on Android. The fix modifiesSafeAreaExtensions.csto detect and respect the window'sSoftInputModesetting, applying keyboard insets whenAdjustResizeis set even ifSafeAreaRegionsdoesn't explicitly include theSoftInputflag.All existing tests pass and comprehensive UI tests have been added:
Successfully merged with main branch (commit e93315f).
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.