From ec1731707eb1cdee6c94aaf605f70a75d3d73550 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 19 Dec 2020 13:16:05 +0100 Subject: [PATCH] Add autocomplete support for text form field --- com.woltlab.wcf/templates/__textFormField.tpl | 1 + wcfsetup/install/files/acp/templates/__textFormField.tpl | 1 + .../lib/system/form/builder/field/TextFormField.class.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/com.woltlab.wcf/templates/__textFormField.tpl b/com.woltlab.wcf/templates/__textFormField.tpl index a918a0175d..8e8206151c 100644 --- a/com.woltlab.wcf/templates/__textFormField.tpl +++ b/com.woltlab.wcf/templates/__textFormField.tpl @@ -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}{* diff --git a/wcfsetup/install/files/acp/templates/__textFormField.tpl b/wcfsetup/install/files/acp/templates/__textFormField.tpl index a918a0175d..8e8206151c 100644 --- a/wcfsetup/install/files/acp/templates/__textFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__textFormField.tpl @@ -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}{* diff --git a/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php index aabc0bd1d1..79c0dd54e0 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php @@ -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; -- 2.20.1