CommunityToolkit / CommunityToolkit/Maui
[BUG] UserStoppedTypingBehavior - ShouldDismissKeyboardAutomatically doesnt work on android
- 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
It's not something I need, just something that I noticed.
`ShouldDismissKeyboardAutomatically` doesn't dismiss the keyboard on Android, but works on iOS.
There is nothing in the docs that indicates it shouldn't work.
### Expected Behavior
Keyboard to dismiss
### Steps To Reproduce
Just add the behaviour to an editor -
```csharp
EditorField.Behaviors.Add(new UserStoppedTypingBehavior()
{
StoppedTypingTimeThreshold = 1000,
MinimumLengthThreshold = 4,
ShouldDismissKeyboardAutomatically = true,
Command = new Command(OnUserStoppedTyping)
});
```
### Link to public reproduction project repository
Sorry, it is not an issue for me as it's not a feature I'm using, thought I'd just report it if anyone else runs into the same thing.
Feel free to close if a repo is required
### Environment
```markdown
- .NET MAUI CommunityToolkit: 9.0.3
- OS: Android (tested on pixel 6 - android 14)
- .NET MAUI: 8.0.90
```
### Anything else?
_No response_
Contributor guide
Research direction
Start by reproducing the issue on Android 14 with the UserStoppedTypingBehavior snippet and the stated .NET MAUI CommunityToolkit 9.0.3 environment. Inspect the UserStoppedTypingBehavior entry point, then verify that setting ShouldDismissKeyboardAutomatically to true dismisses the keyboard on Android while preserving the existing command behavior; add regression coverage if the project provides a relevant test location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, csharp
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100