dotnet / dotnet/maui

[iOS] Shell SearchHandler hardcodes Cancel Button to hidden, causing a keyboard trap

Open
#33,008 0 comments 0 reactions 1 assignee Claimed by @kubaflo View on GitHub
proposal/open shell-search-handler
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

I would like to report a critical usability issue and a limitation in the Shell SearchHandler implementation on iOS.

The Issue:
While the native iOS UISearchBar supports a "Cancel" button, the MAUI Shell implementation appears to hardcode ShowsCancelButton to false (or fails to expose it).
Why this is critical:
Keyboard Trap: On iOS, there is no hardware "Back" button to dismiss the keyboard.
No Exit Route: Once the SearchHandler is focused, the keyboard appears with the Return Key set to "Search". Without a "Cancel" button, there is no way for the user to dismiss the keyboard or exit search mode without executing a query.
API Limitation: I attempted to modify this via the SearchHandler Handler/Mapper, but it seems the Shell's internal logic overrides or ignores these settings, making it impossible to enable the Cancel button via standard customization methods.
Request:
Please remove the hardcoded restriction and expose a ShowsCancelButton property (or default it to true when focused, which is standard iOS behavior). Users need a way to exit the search interaction gracefully.

### Steps to Reproduce

No

### Link to public reproduction project repository

_No response_

### Version with bug

10.0.11

### Is this a regression from previous behavior?

Not sure, did not test other versions

### Last version that worked well

Unknown/Other

### Affected platforms

iOS

### Affected platform versions

_No response_

### Did you find any workaround?

_No response_

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.