question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android and iOS] Keyboard is not dismissed after entering text and tapping Search button in MAUI "SearchBar" control

See original GitHub issue

Description

The keyboard doesn’t get dismissed after we have entered the text in SearchBar control we tap/press the “Search/Enter” button on the keyboard. This happens for both Android and iOS.

The dismiss of keyboard used to work in Xamarin Forms.

Expectation: It is expected that the softkeyboard associated with SearchBar control must get closed after user taps on “Search” button on the keyboard.

https://user-images.githubusercontent.com/20536331/226311214-f84f3b17-70e9-4855-ba0f-f84f1c818c3c.mp4

Steps to Reproduce

  1. Download solution here:

    https://github.com/muffadal53/MAUISearchBarKeyboardBug

  2. Run the solution for Android / iOS.

  3. On MainPageTap into the SearchBar control, type some text and tap “Search/Enter”.

  4. The keyboard does not disappear, it remains visible until the back button is pressed on Android / navigate to some other view in iOS - This is Not OK.

Link to public reproduction project repository

https://github.com/muffadal53/MAUISearchBarKeyboardBug

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

Android 12, iOS 16

Did you find any workaround?

No.

Relevant log output

N/A.

Issue Analytics

  • State:open
  • Created 6 months ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
drasticactionscommented, Mar 20, 2023

Well, if it works on Forms and it doesn’t on MAUI, then it’s a bug. Just wanted to make sure, that’s all.

0reactions
Zhanglirong-Winniecommented, Jun 19, 2023

Verified this issue with Visual Studio Enterprise 17.7.0 Preview 1.0. Can repro on android and iOS platform with sample project. MAUISearch.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

maui - Keyboard not hiding after push done or leave Entry
Completed), is what dismisses the virtual keyboard. This completely disables the entry field but retains the value that had been entered.
Read more >
NET MAUI Shell search
When a search box has input focus, tapping elsewhere on the screen dismisses the onscreen keyboard, and the search box loses input focus....
Read more >
Keyboard Overlapping Your Entry in .NET MAUI? Here is how ...
NET MAUI Community Toolkit 3:30 - Show and Hide On -Screen Keyboard 6:22 - Using a CancellationToken 9:42 - Live Demo on Android...
Read more >
Handle input method visibility
When input focus moves in or out of an editable text field, Android shows or hides the input —such as the on-screen keyboard—as...
Read more >
How to open or dismiss the keyboard in Flutter
Conveniently move towards the next input widget without dismissing the keyboard.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found