user11500484
user11500484

Reputation:

.NET MAUI Editor Control Keyboard Problem

The Editor control in .NET MAUI has no keyboard style with a "Done" button except for "Numeric" and "Telephone" styles. This is a problem. If a user taps in an Editor control, at that point there is no way to dismiss the keyboard to allow other navigation. All other keyboard styles are the same as in the attached image.

enter image description here

Short of writing a Tap handler to programmatically close the keyboard when the user taps somewhere else on the screen, does anyone know of a way to get a keyboard to appear with a "Done" button?

Seems like a glaring omission on MS's part.

Thanks,

Upvotes: 1

Views: 289

Answers (1)

Alexandar May - MSFT
Alexandar May - MSFT

Reputation: 10156

Short of writing a Tap handler to programmatically close the keyboard when the user taps somewhere else on the screen, does anyone know of a way to get a keyboard to appear with a "Done" button?

You can use HideSoftInputOnTapped in a ContentPage. Setting it to true and the soft keyboard will be hidden when tapping anywhere on the page. Note that this property is available in .NET 8 and above:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

             HideSoftInputOnTapped="True"
             >

    <Editor/>
</ContentPage>

Upvotes: 0

Related Questions