Skip to content

Commit 3d5766b

Browse files
committed
default cols & rows for textareas
1 parent 342734c commit 3d5766b

File tree

1 file changed

+19
-2
lines changed
  • lib/internal/Magento/Framework/Data/Form/Element

1 file changed

+19
-2
lines changed

lib/internal/Magento/Framework/Data/Form/Element/Textarea.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@
1515

1616
class Textarea extends AbstractElement
1717
{
18+
/**
19+
* default number of rows
20+
*
21+
* @var int
22+
*/
23+
const DEFAULT_ROWS = 2;
24+
/**
25+
* default number of cols
26+
*
27+
* @var int
28+
*/
29+
const DEFAULT_COLS = 15;
30+
1831
/**
1932
* @param Factory $factoryElement
2033
* @param CollectionFactory $factoryCollection
@@ -30,8 +43,12 @@ public function __construct(
3043
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
3144
$this->setType('textarea');
3245
$this->setExtType('textarea');
33-
$this->setRows(2);
34-
$this->setCols(15);
46+
if (!$this->getRows()) {
47+
$this->setRows(self::DEFAULT_ROWS);
48+
}
49+
if (!$this->getCols()) {
50+
$this->setCols(self::DEFAULT_COLS);
51+
}
3552
}
3653

3754
/**

0 commit comments

Comments
 (0)