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

index b300045a17ce3d825ddc1561c5fc299b7a7546cc..3a114ecbe3c3ced8ca8da39abe7b2d58409f9720 100644 (file)
@@ -2,6 +2,7 @@
        *}name="{@$field->getPrefixedId()}" {*
        *}rows="{@$field->getRows()}"{*
        *}{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 b300045a17ce3d825ddc1561c5fc299b7a7546cc..3a114ecbe3c3ced8ca8da39abe7b2d58409f9720 100644 (file)
@@ -2,6 +2,7 @@
        *}name="{@$field->getPrefixedId()}" {*
        *}rows="{@$field->getRows()}"{*
        *}{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 fea2317f2e8de050cff4c2034dc6e9b645879448..63805bf300bf38537faad5a88a7947b96b13830e 100644 (file)
@@ -22,6 +22,17 @@ class MultilineTextFormField extends TextFormField {
         */
        protected $templateName = '__multilineTextFormField';
        
+       /**
+        * @inheritDoc
+        * @since       5.4
+        */
+       protected function getValidAutoCompleteTokens(): array {
+               return array_merge(
+                       parent::getValidAutoCompleteTokens(),
+                       ['street-address']
+               );
+       }
+       
        /**
         * Returns the number of rows of the textarea. If the number of rows has not been
         * explicitly set, `10` is returned.