From 10e807f25aeabc425c575970bd0319516c807dfb Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 21 Dec 2020 19:19:06 +0100 Subject: [PATCH] Add input mode support for `multifactor\backup\CodeFormField ` --- com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl | 4 ++-- .../files/acp/templates/__multifactorBackupCodeField.tpl | 4 ++-- .../system/user/multifactor/backup/CodeFormField.class.php | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl b/com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl index ab41b26c6a..5623d65ed2 100644 --- a/com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl +++ b/com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl @@ -3,8 +3,8 @@ *}name="{@$field->getPrefixedId()}" {* *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {* *}{if !$field->getFieldClasses()|empty}class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}" {/if}{* - *}pattern="[0-9\s]*" {* - *}inputmode="numeric"{* + *}pattern="[0-9\s]*"{* + *}{if $field->getInputMode() !== null} inputmode="{$field->getInputMode()}"{/if}{* *}{if $field->getChunks() && $field->getChunkLength()} size="{$field->getChunks() - 1 + $field->getChunks() * $field->getChunkLength()}"{/if}{* *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{* *}{if $field->isAutofocused()} autofocus{/if}{* diff --git a/wcfsetup/install/files/acp/templates/__multifactorBackupCodeField.tpl b/wcfsetup/install/files/acp/templates/__multifactorBackupCodeField.tpl index ab41b26c6a..5623d65ed2 100644 --- a/wcfsetup/install/files/acp/templates/__multifactorBackupCodeField.tpl +++ b/wcfsetup/install/files/acp/templates/__multifactorBackupCodeField.tpl @@ -3,8 +3,8 @@ *}name="{@$field->getPrefixedId()}" {* *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {* *}{if !$field->getFieldClasses()|empty}class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}" {/if}{* - *}pattern="[0-9\s]*" {* - *}inputmode="numeric"{* + *}pattern="[0-9\s]*"{* + *}{if $field->getInputMode() !== null} inputmode="{$field->getInputMode()}"{/if}{* *}{if $field->getChunks() && $field->getChunkLength()} size="{$field->getChunks() - 1 + $field->getChunks() * $field->getChunkLength()}"{/if}{* *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{* *}{if $field->isAutofocused()} autofocus{/if}{* diff --git a/wcfsetup/install/files/lib/system/user/multifactor/backup/CodeFormField.class.php b/wcfsetup/install/files/lib/system/user/multifactor/backup/CodeFormField.class.php index b025ee9ba4..ed88fa3be5 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/backup/CodeFormField.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/backup/CodeFormField.class.php @@ -38,6 +38,7 @@ class CodeFormField extends TextFormField { $this->minimumLength($this->getChunks() * $this->getChunkLength()); $this->addFieldClass('multifactorBackupCode'); $this->autoComplete('off'); + $this->inputMode('numeric'); $placeholder = ''; $gen = Helper::digitStream(); -- 2.20.1