Add autocomplete support for text form field
authorMatthias Schmidt <gravatronics@live.com>
Sat, 19 Dec 2020 12:16:05 +0000 (13:16 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 17:53:08 +0000 (18:53 +0100)
com.woltlab.wcf/templates/__textFormField.tpl
wcfsetup/install/files/acp/templates/__textFormField.tpl
wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php

index a918a0175defd25e6fc59379e60539fc1a5bcc23..8e8206151cc71267bcc2ba7422b4df3669b16baf 100644 (file)
@@ -3,6 +3,7 @@
        *}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->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
        *}{if $field->isAutofocused()} autofocus{/if}{*
        *}{if $field->isRequired()} required{/if}{*
        *}{if $field->isImmutable()} disabled{/if}{*
index a918a0175defd25e6fc59379e60539fc1a5bcc23..8e8206151cc71267bcc2ba7422b4df3669b16baf 100644 (file)
@@ -3,6 +3,7 @@
        *}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->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
        *}{if $field->isAutofocused()} autofocus{/if}{*
        *}{if $field->isRequired()} required{/if}{*
        *}{if $field->isImmutable()} disabled{/if}{*
index aabc0bd1d1cd720b0bd77dcc0bd8e9a472d6fcbb..79c0dd54e0948d421e52483bb23a1d73297e397c 100644 (file)
@@ -13,7 +13,8 @@ use wcf\system\language\LanguageFactory;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class TextFormField extends AbstractFormField implements IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPlaceholderFormField {
+class TextFormField extends AbstractFormField implements IAutoCompleteFormField, IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPlaceholderFormField {
+       use TTextAutoCompleteFormField;
        use TAutoFocusFormField;
        use TCssClassFormField;
        use TImmutableFormField;