diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Textarea.php b/lib/internal/Magento/Framework/Data/Form/Element/Textarea.php index 724a609189ba9..ebc4eebec32ae 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Textarea.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Textarea.php @@ -13,8 +13,28 @@ use Magento\Framework\Escaper; +/** + * @method Textarea setExtType($extType) + * @method mixed getCols() + * @method Textarea setCols($cols) + * @method mixed getRows() + * @method Textarea setRows($rows) + */ class Textarea extends AbstractElement { + /** + * default number of rows + * + * @var int + */ + const DEFAULT_ROWS = 2; + /** + * default number of cols + * + * @var int + */ + const DEFAULT_COLS = 15; + /** * @param Factory $factoryElement * @param CollectionFactory $factoryCollection @@ -30,8 +50,12 @@ public function __construct( parent::__construct($factoryElement, $factoryCollection, $escaper, $data); $this->setType('textarea'); $this->setExtType('textarea'); - $this->setRows(2); - $this->setCols(15); + if (!$this->getRows()) { + $this->setRows(self::DEFAULT_ROWS); + } + if (!$this->getCols()) { + $this->setCols(self::DEFAULT_COLS); + } } /** @@ -66,8 +90,8 @@ public function getElementHtml() { $this->addClass('textarea'); $html = '"; $html .= $this->getAfterElementHtml();