Add input mode support for `multifactor\totp\CodeFormField`
authorMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 18:19:39 +0000 (19:19 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 18:19:39 +0000 (19:19 +0100)
com.woltlab.wcf/templates/__multifactorTotpCodeField.tpl
wcfsetup/install/files/acp/templates/__multifactorTotpCodeField.tpl
wcfsetup/install/files/lib/system/user/multifactor/totp/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 9496976c7caf267c097c04a122c0c70376498d86..d450c10a51f7678c1714de934d554f80d6586d5e 100644 (file)
@@ -31,6 +31,7 @@ class CodeFormField extends TextFormField {
                $this->maximumLength(Totp::CODE_LENGTH);
                $this->addFieldClass('multifactorTotpCode');
                $this->autoComplete('off');
+               $this->inputMode('numeric');
                
                $placeholder = '';
                $gen = Helper::digitStream();