From ff3a6f72df39cca2bf40e46c10a6a9e20b39f78f Mon Sep 17 00:00:00 2001 From: Sabina Talipova <87288324+sabina-talipova@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:00:24 +1300 Subject: [PATCH] FIX HTMLEditorField::setRows minimal hieght (#10965) --- src/Forms/HTMLEditor/HTMLEditorField.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Forms/HTMLEditor/HTMLEditorField.php b/src/Forms/HTMLEditor/HTMLEditorField.php index 5e64ed038..2675875d6 100644 --- a/src/Forms/HTMLEditor/HTMLEditorField.php +++ b/src/Forms/HTMLEditor/HTMLEditorField.php @@ -114,19 +114,22 @@ class HTMLEditorField extends TextareaField 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() ); }