dotnet/maui

Add "Keyboard.None"

Open

#10,331 创建于 2022年9月26日

在 GitHub 查看
 (6 评论) (11 反应) (0 负责人)C# (1,951 fork)batch import
area-keyboardhelp wantedlegacy-area-controlsproposal/open

仓库指标

Star
 (23,245 star)
PR 合并指标
 (平均合并 47天 9小时) (30 天内合并 248 个 PR)

描述

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

贡献者指南