*}value="{if !$field->isI18n() || !$field->hasI18nValues()}{$field->getValue()}{/if}" {*
*}maxlength="191"{*
*}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
+ *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
*}{if $field->isAutofocused()} autofocus{/if}{*
*}{if $field->isRequired()} required{/if}{*
*}{if $field->isImmutable()} disabled{/if}{*
*}value="{if !$field->isI18n() || !$field->hasI18nValues()}{$field->getValue()}{/if}" {*
*}maxlength="191"{*
*}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
+ *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
*}{if $field->isAutofocused()} autofocus{/if}{*
*}{if $field->isRequired()} required{/if}{*
*}{if $field->isImmutable()} disabled{/if}{*
* @package WoltLabSuite\Core\System\Form\Builder\Field
* @since 5.2
*/
-class EmailFormField extends AbstractFormField implements IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IPlaceholderFormField {
+class EmailFormField extends AbstractFormField implements IAutoCompleteFormField, IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IPlaceholderFormField {
+ use TAutoCompleteFormField;
use TAutoFocusFormField;
use TCssClassFormField;
use TImmutableFormField;
$this->addFieldClass('long');
}
+ /**
+ * @inheritDoc
+ * @since 5.4
+ */
+ protected function getValidAutoCompleteTokens(): array {
+ return array_merge(['email'], array_map(function(string $context): string {
+ return $context . ' email';
+ }, ['home', 'work', 'mobile', 'fax', 'pager']));
+ }
+
/**
* @inheritDoc
*/