[FEATURE] Added autofocus attribute to textfield and textarea 94/21994/2
authorTim Spiekerkoetter <tim.spiekerkoetter@hdnet.de>
Sat, 6 Jul 2013 10:35:35 +0000 (12:35 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 9 Aug 2013 19:03:43 +0000 (21:03 +0200)
The ViewHelpers f:form.textfield and f:form.textarea were lacking the
HTML5 "autofocus" attribute. It is available for button, input and
textarea. Now Fluid reflects this correctly by adding this attribute to
the initializeArguments methods for TextareaViewHelper and
TextfieldViewHelper.

Resolves: #48689
Releases: 6.2
Change-Id: I00480dc4e76b2854dc0be36d150d32c7b432d93d
Reviewed-on: https://review.typo3.org/21994
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/fluid/Classes/ViewHelpers/Form/TextareaViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Form/TextfieldViewHelper.php

index f3aca57..d3099ac 100644 (file)
@@ -41,6 +41,7 @@ class TextareaViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormF
         */
        public function initializeArguments() {
                parent::initializeArguments();
+               $this->registerTagAttribute('autofocus', 'string', 'Specifies that a text area should automatically get focus when the page loads');
                $this->registerTagAttribute('rows', 'int', 'The number of rows of a text area');
                $this->registerTagAttribute('cols', 'int', 'The number of columns of a text area');
                $this->registerTagAttribute('disabled', 'string', 'Specifies that the input element should be disabled when the page loads');
index 2d2a374..1b40565 100644 (file)
@@ -40,6 +40,7 @@ class TextfieldViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractForm
         */
        public function initializeArguments() {
                parent::initializeArguments();
+               $this->registerTagAttribute('autofocus', 'string', 'Specifies that a input should automatically get focus when the page loads');
                $this->registerTagAttribute('disabled', 'string', 'Specifies that the input element should be disabled when the page loads');
                $this->registerTagAttribute('maxlength', 'int', 'The maxlength attribute of the input field (will not be validated)');
                $this->registerTagAttribute('readonly', 'string', 'The readonly attribute of the input field');