silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
720 stars 823 forks source link

FIX HTMLEditorField::setRows minimal height #10965

Closed sabina-talipova closed 8 months ago

sabina-talipova commented 11 months ago

Description

The TinyMCE configuration introduces the height => 'auto' property, this will help set the height value for some nested elements. This height value will override the value specified in the _config.php file, if there is one. Therefore, when using this setRows method, it is worth considering that the height specified in _config.php file will not be taken into account.

Test steps

Update Page.php with the following code.


use use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Forms\HTMLEditor\HTMLEditorField;

class Page extends SiteTree
{
  public function getCMSFields()
  {
      $fields = parent::getCMSFields();
      $fields->removeByName('Content');
      $fields->addFieldToTab('Root.Main', HTMLEditorField::create('OtherContent1')->setRows(2));
      $fields->addFieldToTab('Root.Main', HTMLEditorField::create('OtherContent2')->setRows(4));
      $fields->addFieldToTab('Root.Main', HTMLEditorField::create('OtherContent3')->setRows(5));
      $fields->addFieldToTab('Root.Main', HTMLEditorField::create('OtherContent4')->setRows(10));

      return $fields;
  }
}

Parent issue