Add input mode support for `multifactor\email\CodeFormField`
authorMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 18:19:19 +0000 (19:19 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 18:19:19 +0000 (19:19 +0100)
com.woltlab.wcf/templates/__multifactorEmailCodeField.tpl
wcfsetup/install/files/acp/templates/__multifactorEmailCodeField.tpl
wcfsetup/install/files/lib/system/user/multifactor/email/CodeFormField.class.php

index baf29dacd4954fd85e4588b424c30f97e39bd3f3..d07dfc7a45dcc7c18ea9e6164ae5daed99fcd358 100644 (file)
@@ -4,8 +4,8 @@
        *}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}{*
        *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{*
-       *}pattern="[0-9]*" {*
-       *}inputmode="numeric"{*
+       *}pattern="[0-9]*"{*
+       *}{if $field->getInputMode() !== null} inputmode="{$field->getInputMode()}"{/if}{*
        *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
        *}{if $field->isAutofocused()} autofocus{/if}{*
        *}{if $field->isRequired()} required{/if}{*
index baf29dacd4954fd85e4588b424c30f97e39bd3f3..d07dfc7a45dcc7c18ea9e6164ae5daed99fcd358 100644 (file)
@@ -4,8 +4,8 @@
        *}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}{*
        *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{*
-       *}pattern="[0-9]*" {*
-       *}inputmode="numeric"{*
+       *}pattern="[0-9]*"{*
+       *}{if $field->getInputMode() !== null} inputmode="{$field->getInputMode()}"{/if}{*
        *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
        *}{if $field->isAutofocused()} autofocus{/if}{*
        *}{if $field->isRequired()} required{/if}{*
index 0b2ef777f26ffd097d8e8ccf4adc874fb1681427..54fe658d447030dd929d64b58c9275aeed51f5af 100644 (file)
@@ -27,6 +27,7 @@ class CodeFormField extends TextFormField {
                $this->maximumLength(EmailMultifactorMethod::LENGTH);
                $this->addFieldClass('multifactorEmailCode');
                $this->autoComplete('off');
+               $this->inputMode('numeric');
                
                $placeholder = '';
                $gen = Helper::digitStream();