Skip to content

[BUG] Software keyboard stays open when there is an Entry in a Popup and there is no easy way to close it on iOS #3058

@holecekp

Description

@holecekp

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

I've created a simple Popup containing an Entry and OK and Cancel buttons. The Entry gets focus when the Popup is opened so that the user could enter the input to the Entry. However with Popup v2 software keyboard behaves very unnatural on Android and even worse on iOS and stays open.

The keyboard is not closed when the user taps on anywhere in the dialog (Android and iOS). The reason is that the Popup v2 must be a View, which doesn't contain HideSoftInputOnTapped and, at the same time, it ignores the value of this property from the page that opened the dialog. As a workaround, I added a TapGestureRecognizer to the dialog which closes the keyboard manually. This fixed this problem, but there is another one specific to iOS.

Please consider adding HideSoftInputOnTapped property also to Popups, or using the value of the HideSoftInputOnTapped from the containing page.

Note:
When I opened the dialog on my iPhone, I found another issue. The OK and Cancel buttons are in my case just above the software keyboard but tapping on either of the buttons does nothing. I found out later that this isn't CommunityToolkit issue. It's an issue in MAUI itself. MAUI renders a blue floating circle button in the right-hand part of the screen just above the the software keyboard. The problem is that any touch input in the same "row" as the circle button is ignored. So the OK and Cancel buttons are on the left next to the circle button but they cannot be tapped which is very confusing for users. I'm mentioning it just because it was in my original report and I found out that it's not specific to CommunityToolkit later.

Expected Behavior

It should be possible to create Popup dialogs, which behaves naturally when the software keyboard is opened and closes the software keyboard when the user taps anywhere in the dialog outside the text field.

Steps To Reproduce

  1. Clone the project from https://github.com/holecekp/MauiBugsPopup and run it on iOS or Android
  2. Tap on the Open Popup dialog. A software keyboard is opened (for iOS a physical device is preferable because the software keyboard isn't shown in a simulator)
  3. Tapping outside the dialog closes the keyboard and the popup (expected behavior)
  4. However tapping inside the dialog on the background does nothing and the keyboard stays opened. Setting HideSoftInputOnTapped="True" for the MainPage has no effect on this behavior.
  5. Optional: On a physical iOS device with a small screen (iPhone SE 2020), it's also impossible to close this dialog by tapping on the OK or Cancel buttons in the popup.
Image

Link to public reproduction project repository

https://github.com/holecekp/MauiBugsPopup

Environment

- .NET MAUI CommunityToolkit:14.0.0 (the issue was present also in 13.0.0)
- OS: iOS 26.2, Android
- .NET MAUI: 10.0.30

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions