Skip to content

RichEditor minRows()/maxRows() support - #20258

Open
pxlrbt wants to merge 4 commits into
filamentphp:4.xfrom
pxlrbt:feat/rce-rows
Open

RichEditor minRows()/maxRows() support#20258
pxlrbt wants to merge 4 commits into
filamentphp:4.xfrom
pxlrbt:feat/rce-rows

Conversation

@pxlrbt

@pxlrbt pxlrbt commented Jul 22, 2026

Copy link
Copy Markdown
Member

Description

Textarea natively supports ->rows() but there was no option for RichEditor so far. Since this is not a native feature, I thought it was useful to add both min and max limits. It uses lh unit which is supported in baseline: https://caniuse.com/wf-lh

Visual changes

CleanShot.2026-07-22.at.21.58.29.mp4

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

pxlrbt added 2 commits July 22, 2026 22:00
Signed-off-by: Dennis Koch <info@pixelarbeit.de>
Signed-off-by: Dennis Koch <info@pixelarbeit.de>

@danharrin danharrin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike a textarea where line height is fixed, the rich editor has a variety of line heights based on the element used (heading, paragraph) like the markdown editor.

The markdown editor has min/max height, right? So should we not mirror that pattern for the rich editor instead of min/max rows?

@danharrin danharrin added enhancement New feature or request pending changes labels Jul 22, 2026
@danharrin danharrin added this to the v4 milestone Jul 22, 2026
@pxlrbt

pxlrbt commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

You're right, it's probably the better variant. I only compared it to the Textarea and forgot about the MarkdownEditor. I still like the idea of "rows" for a simple RichEditor but I can just pass the 3lh then

pxlrbt added 2 commits July 23, 2026 02:06
Signed-off-by: Dennis Koch <info@pixelarbeit.de>
Signed-off-by: Dennis Koch <info@pixelarbeit.de>
@pxlrbt

pxlrbt commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

The approach I took is a bit different from the markdown editor. While that one works via JS I decided to use plain CSS. Because we need to apply the height restrictions to the content and not the outer field container, I pass them down via CSS vars. Might look a bit weird but works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pending review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants