*}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}{*
+ *}{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}{*
*}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}{*
+ *}{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}{*
* @package WoltLabSuite\Core\System\Form\Builder\Field
* @since 5.2
*/
-class TextFormField extends AbstractFormField implements IAutoCompleteFormField, IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPlaceholderFormField {
+class TextFormField extends AbstractFormField implements IAutoCompleteFormField, IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IInputModeFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPlaceholderFormField {
use TTextAutoCompleteFormField;
use TAutoFocusFormField;
use TCssClassFormField;
use TImmutableFormField;
+ use TInputModeFormField;
use TI18nFormField {
validate as protected i18nValidate;
}
$this->addFieldClass('long');
}
+ /**
+ * @inheritDoc
+ */
+ protected function getValidInputModes(): array {
+ return [
+ 'text',
+ 'tel',
+ 'url',
+ 'email',
+ 'numeric',
+ 'decimal',
+ 'search',
+ ];
+ }
+
/**
* @inheritDoc
*/