Skip to content

Commit

Permalink
FIX HTMLEditorField::setRows minimal hieght (#10965)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabina-talipova authored Jan 11, 2024
1 parent ad8cf99 commit ff3a6f7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Forms/HTMLEditor/HTMLEditorField.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,22 @@ public function __construct($name, $title = null, $value = '', $config = null)

public function getAttributes()
{
$config = $this->getEditorConfig();
// Fix CSS height based on rows
$rowHeight = $this->config()->get('fixed_row_height');
$attributes = [];
if ($rowHeight) {
if ($rowHeight && ($config instanceof TinyMCEConfig)) {
$height = $this->getRows() * $rowHeight;
$attributes['style'] = sprintf('height: %dpx;', $height);
$config = clone $config;
$config->setOption('height', 'auto');
}

// Merge attributes
return array_merge(
$attributes,
parent::getAttributes(),
$this->getEditorConfig()->getAttributes()
$config->getAttributes()
);
}

Expand Down

0 comments on commit ff3a6f7

Please sign in to comment.