Skip to content

Add SoftInputKeyboardPopup and integrate keyboard handling for popups - #3117

Open
FabriBertani wants to merge 14 commits into
CommunityToolkit:mainfrom
FabriBertani:bug/keybpard_overlapping_on_popup-issue
Open

FabriBertani wants to merge 14 commits into
CommunityToolkit:mainfrom
FabriBertani:bug/keybpard_overlapping_on_popup-issue

Conversation

@FabriBertani

@FabriBertani FabriBertani commented Feb 24, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Has a linked Issue, and the Issue has been approved(bug) or Championed (feature/proposal)
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls

Additional information

  • Tested on .Net Maui 9 and 10.
  • Android:
    • 16
    • 15
    • 14
  • iOS:
    • iPhone 15, iPhone 15 Pro, iPhone SE - 17.5
    • iPhone 17 Pro - 26.2

@pictos pictos left a comment

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.

Just a small adjustments, also can you remove the comments on code?

Comment thread src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs Outdated
Comment thread src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs Outdated
Comment thread src/CommunityToolkit.Maui/Views/Popup/PopupPage.shared.cs Outdated
@FabriBertani

Copy link
Copy Markdown
Contributor Author

Just a small adjustments, also can you remove the comments on code?

Just the comments or the summaries as well?

@pictos

pictos commented Feb 25, 2026

Copy link
Copy Markdown
Member

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

@FabriBertani

Copy link
Copy Markdown
Contributor Author

done

Comment thread src/CommunityToolkit.Maui/Views/Popup/Popup.ios.cs

@pictos pictos left a comment

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.

Thanks for you contribution!
LGTM

@dotnet-policy-service dotnet-policy-service Bot added stale The author has not responded in over 30 days help wanted This proposal has been approved and is ready to be implemented labels Mar 31, 2026
@yevgeny-sotnikov

Copy link
Copy Markdown

@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

@pictos

pictos commented Sep 29, 2026

Copy link
Copy Markdown
Member

@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

@TheCodeTraveler TheCodeTraveler added the needs discussion Discuss it on the next Monthly standup label Sep 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Platform lifecycle, state restoration, compatibility, and linked-issue requirements remain unresolved.

Review effort: Balanced
Findings: 1 High severity · 3 Medium severity

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.

Comment thread src/CommunityToolkit.Maui/Views/Popup/PopupPage.shared.cs Outdated
Comment thread src/CommunityToolkit.Maui/Views/Popup/Popup.android.cs Outdated
Comment thread src/CommunityToolkit.Maui/Views/Popup/Popup.ios.cs Outdated
Comment thread src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs
@TheCodeTraveler

Copy link
Copy Markdown
Collaborator

@FabriBertani Could you please address the CoPilot review comments?

@TheCodeTraveler TheCodeTraveler removed help wanted This proposal has been approved and is ready to be implemented stale The author has not responded in over 30 days labels Oct 1, 2026
@TheCodeTraveler TheCodeTraveler self-assigned this Oct 1, 2026
@FabriBertani

Copy link
Copy Markdown
Contributor Author

@FabriBertani Could you please address the CoPilot review comments?

Sure, I'll check them.

@TheCodeTraveler TheCodeTraveler removed the needs discussion Discuss it on the next Monthly standup label Oct 8, 2026
@TheCodeTraveler
TheCodeTraveler requested a balanced review from Copilot October 8, 2026 23:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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


partial void OnPlatformPopupOpened()
{
var android = Microsoft.Maui.Controls.Application.Current?.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>();
Comment thread src/CommunityToolkit.Maui/Views/Popup/Popup.ios.cs Outdated
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;
Comment thread src/CommunityToolkit.Maui/Views/Popup/PopupPage.shared.cs
TheCodeTraveler and others added 4 commits October 8, 2026 16:19
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

This branch has not been deployed

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

Labels

None yet

Projects

None yet

5 participants