Repository navigation
Add SoftInputKeyboardPopup and integrate keyboard handling for popups - #3117
FabriBertani wants to merge 14 commits into
Conversation
pictos
left a comment
There was a problem hiding this comment.
Just a small adjustments, also can you remove the comments on code?
Just the comments or the summaries as well? |
just the comments, the summaries are fine |
|
done |
…keyboard handling
pictos
left a comment
There was a problem hiding this comment.
Thanks for you contribution!
LGTM
|
@pictos when this PR will be merged? I have same issue and this block an ability to create popup with entry field at real app |
|
@yevgeny-sotnikov I'm no longer in the core maintainer team, so I don't know about the schedule. Calling @CommunityToolkit/maui to see if they can help you |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Platform lifecycle, state restoration, compatibility, and linked-issue requirements remain unresolved.
Review effort: Balanced
Findings: 1
Open (4)
What changed in this PR
Attempts to prevent software keyboards from overlapping popup content on Android and iOS.
Changes:
- Adds popup lifecycle hooks and keyboard-aware safe-area handling.
- Implements platform-specific Android and iOS adjustments.
- Adds a sample popup demonstrating keyboard controls.
| File | Description |
|---|---|
PopupPage.shared.cs |
Configures soft-input safe-area behavior. |
Popup.shared.cs |
Adds platform lifecycle hooks. |
Popup.ios.cs |
Handles iOS keyboard notifications and insets. |
Popup.android.cs |
Changes Android soft-input resize mode. |
SoftInputKeyboardPopup.xaml.cs |
Implements the sample popup. |
SoftInputKeyboardPopup.xaml |
Defines keyboard-focused sample content. |
PopupsPage.xaml.cs |
Opens the new sample. |
PopupsPage.xaml |
Adds the sample navigation button. |
MauiProgram.cs |
Registers the sample popup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@FabriBertani Could you please address the CoPilot review comments? |
Sure, I'll check them. |
There was a problem hiding this comment.
🟡 Changes recommended
Platform lifecycle, iOS geometry, modal-page inheritance, and multi-window state issues can leave popups incorrectly positioned or keyboard settings unrestored.
8 open findings
Scope Android soft-input mode state per popup window · New Handle keyboard frame changes to keep popup insets current · New Resolve the popup controller from its native view responder chain · New Calculate keyboard overlap without double-counting safe-area insets · New Ensure popup teardown runs on every navigation removal path · New Resolve the top modal before inheriting keyboard settings · New Remove unnecessary null-forgiving operator · New Replace misleading Try-pattern method with a void side-effect method · New
4 resolved since last review
🧠 Review effort: Balanced
|
|
||
| partial void OnPlatformPopupOpened() | ||
| { | ||
| var android = Microsoft.Maui.Controls.Application.Current?.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>(); |
| return; | ||
| } | ||
|
|
||
| viewController ??= popupNativeView.Window?.RootViewController?.PresentedViewController; |
| return; | ||
| } | ||
|
|
||
| viewController.AdditionalSafeAreaInsets = new UIEdgeInsets(0, 0, args.FrameEnd.Height, 0); |
| { | ||
| Closed?.Invoke(this, EventArgs.Empty); | ||
|
|
||
| OnPlatformPopupClosed(); |
| { | ||
| token.ThrowIfCancellationRequested(); | ||
|
|
||
| TryInheritHideSoftInputFromPresentingPage(navigation.NavigationStack.LastOrDefault() ?? null); |
| shell.Items.Add(currentPage); | ||
|
|
||
| Assert.NotNull(Application.Current); | ||
| Application.Current!.Windows[0].Page = shell; |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Conflicts: # samples/CommunityToolkit.Maui.Sample/MauiProgram.cs # samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupsPage.xaml # samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupsPage.xaml.cs
…hub.com/FabriBertani/Maui into bug/keybpard_overlapping_on_popup-issue



Description of Change
Fix added for the issue related to the OS keyboard overlapping the popup content on Android and iOS, with backward compatibility to .NET9
This fix behaves on both platforms the same as Android adjust resize input option, by pushing the popup content above the keyboard.
Linked Issues
PR Checklist
approved(bug) orChampioned(feature/proposal)mainat time of PRAdditional information