*}name="{@$field->getPrefixedId()}" {*
*}value="{$field->getValue()}" {*
*}class="long"{*
+ *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
*}{if $field->isAutofocused()} autofocus{/if}{*
*}{if $field->isRequired()} required{/if}{*
*}{if $field->isImmutable()} disabled{/if}{*
*}name="{@$field->getPrefixedId()}" {*
*}value="{$field->getValue()}" {*
*}class="long"{*
+ *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
*}{if $field->isAutofocused()} autofocus{/if}{*
*}{if $field->isRequired()} required{/if}{*
*}{if $field->isImmutable()} disabled{/if}{*
<?php
namespace wcf\system\form\builder\field\user;
use wcf\system\form\builder\field\AbstractFormField;
+use wcf\system\form\builder\field\IAutoCompleteFormField;
use wcf\system\form\builder\field\IAutoFocusFormField;
use wcf\system\form\builder\field\IImmutableFormField;
use wcf\system\form\builder\field\IMaximumLengthFormField;
use wcf\system\form\builder\field\IMinimumLengthFormField;
use wcf\system\form\builder\field\INullableFormField;
use wcf\system\form\builder\field\IPlaceholderFormField;
+use wcf\system\form\builder\field\TAutoCompleteFormField;
use wcf\system\form\builder\field\TAutoFocusFormField;
use wcf\system\form\builder\field\TDefaultIdFormField;
use wcf\system\form\builder\field\TImmutableFormField;
* @package WoltLabSuite\Core\System\Form\Builder\Field\User
* @since 5.2
*/
-class UsernameFormField extends AbstractFormField implements IAutoFocusFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, INullableFormField, IPlaceholderFormField {
+class UsernameFormField extends AbstractFormField implements IAutoCompleteFormField, IAutoFocusFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, INullableFormField, IPlaceholderFormField {
+ use TAutoCompleteFormField;
use TAutoFocusFormField;
use TDefaultIdFormField;
use TImmutableFormField;
$this->minimumLength(3);
}
+ /**
+ * @inheritDoc
+ * @since 5.4
+ */
+ protected function getValidAutoCompleteTokens(): array {
+ return ['username'];
+ }
+
/**
* @inheritDoc
*/