From a3083687067863398f7242da8b5d5ae0c3cb95bb Mon Sep 17 00:00:00 2001 From: zhoukechen Date: Thu, 16 Nov 2023 09:06:37 +0800 Subject: [PATCH] add new input type Signed-off-by: zhoukechen Change-Id: I872613128a46f3866f75b76b89b6f687ff28cfb1 --- capability/editing/KeyboardTypeMapper.h | 1 + capability/editing/KeyboardTypeMapper.m | 4 +++- capability/editing/text_input_connection_impl.mm | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/capability/editing/KeyboardTypeMapper.h b/capability/editing/KeyboardTypeMapper.h index b8304c6..835582a 100644 --- a/capability/editing/KeyboardTypeMapper.h +++ b/capability/editing/KeyboardTypeMapper.h @@ -18,6 +18,7 @@ FOUNDATION_EXPORT NSString *const TextInputTypePhone; FOUNDATION_EXPORT NSString *const TextInputTypeEmailAddress; FOUNDATION_EXPORT NSString *const TextInputTypeURL; FOUNDATION_EXPORT NSString *const TextInputTypeVisiblePassword; +FOUNDATION_EXPORT NSString *const TextInputTypeNumberPassword; // TextCapitalization FOUNDATION_EXPORT NSString *const TextCapitalizationCharacters; diff --git a/capability/editing/KeyboardTypeMapper.m b/capability/editing/KeyboardTypeMapper.m index 34af843..fcf107e 100644 --- a/capability/editing/KeyboardTypeMapper.m +++ b/capability/editing/KeyboardTypeMapper.m @@ -13,6 +13,7 @@ NSString *const TextInputTypePhone = @"TextInputType.phone"; NSString *const TextInputTypeEmailAddress = @"TextInputType.emailAddress"; NSString *const TextInputTypeURL = @"TextInputType.url"; NSString *const TextInputTypeVisiblePassword = @"TextInputType.visiblePassword"; +NSString *const TextInputTypeNumberPassword = @"TextInputType.NUMBER_PASSWORD"; // TextCapitalization NSString *const TextCapitalizationCharacters = @"TextCapitalization.characters"; @@ -42,7 +43,8 @@ NSString *const TextInputActionNewline = @"TextInputAction.newline"; TextInputTypeNumber: @(UIKeyboardTypeNumberPad), TextInputTypePhone: @(UIKeyboardTypePhonePad), TextInputTypeEmailAddress: @(UIKeyboardTypeEmailAddress), - TextInputTypeURL: @(UIKeyboardTypeURL) + TextInputTypeURL: @(UIKeyboardTypeURL), + TextInputTypeNumberPassword: @(UIKeyboardTypeNumberPad) }; } diff --git a/capability/editing/text_input_connection_impl.mm b/capability/editing/text_input_connection_impl.mm index 3ee75d4..1604f55 100755 --- a/capability/editing/text_input_connection_impl.mm +++ b/capability/editing/text_input_connection_impl.mm @@ -81,6 +81,9 @@ void TextInputConnectionImpl::Show(bool isFocusViewChanged, int32_t instanceId){ }else if(inputType == TextInputType::VISIBLE_PASSWORD){ inputTypeName = TextInputTypeVisiblePassword; obscureText = 1; + }else if(inputType == TextInputType::NUMBER_PASSWORD){ + inputTypeName = TextInputTypeNumberPassword; + obscureText = 1; } NSString* inputFilter = [NSString stringWithFormat:@"%s", config_.inputFilter.c_str()]; -- Gitee