CommunityToolkit / CommunityToolkit/Maui

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

Open
#3,058 4 comments 0 reactions 0 assignees View on GitHub
bug unverified
Dominant language
C#
Stars
2.7k
Forks
500
Avg merge
2d 14h
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

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

- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

### 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

```markdown
- .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_

Contributor guide

Open the contributing guide

Research direction

Start with the Popup v2 implementation and the MauiBugsPopup reproduction project, then compare the behavior on iOS and Android. Check how HideSoftInputOnTapped is handled on MainPage versus inside the Popup; done means tapping the Popup outside its Entry closes the software keyboard without breaking Popup interactions.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp, ios
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.