dotnet/maui

Add "Keyboard.None"

Open

#10.331 aperta il 26 set 2022

Vedi su GitHub
 (6 commenti) (11 reazioni) (0 assegnatari)C# (1951 fork)batch import
area-keyboardhelp wantedlegacy-area-controlsproposal/open

Metriche repository

Star
 (23.245 star)
Metriche merge PR
 (Merge medio 47g 9h) (248 PR mergiate in 30 g)

Descrizione

Description

Currently I can only choose what type of keyboard I want for a specific Entry, but in order to fully disable the keyboard I have to do some weird workarounds with #ifs and custom renderers involved: https://stackoverflow.com/questions/73199602/need-a-way-to-hide-soft-keyboard-in-mauis-editor-entry-fields (the first link in google search for me). I think such capability should be implemented on platform layer and be available to all MAUI users without that much effort to use it.

The end result of this proposal should look like this (taken from the article about how to implement such feature in Xamarin, which also didn't have a build-in solution for it):

Public API Changes

In https://github.com/dotnet/maui/blob/main/src/Core/src/Primitives/Keyboard.cs:

public class Keyboard
{
    ...
+    public static Keybord None
+    {
+        ...
+    }
}

https://github.com/dotnet/maui/blob/main/src/Core/src/Converters/KeyboardTypeConverter.cs should also be modified.

Intended Use-Case

Well, see almost any calculator app for reference. It provides an input field but doesn't trigger the system keyboard when tapped/clicked. In general the feature would be very useful when the app needs a specific control over what user is typing. Such apps usually have their own keyboard or a limited set of buttons for data input

Guida contributor