Skip to content

Conversation

@SimonBroekaert
Copy link
Contributor

Description

When rendering the content of a Filament\Forms\Components\RichEditor field using a Filament\Infolists\Components\TextEntry when the model is set up with the Filament\Forms\Components\RichEditor\Models\Contracts\HasRichContent contract and Filament\Forms\Components\RichEditor\Models\Concerns\InteractsWithRichContent trait, the placeholder is never rendered.

This is because the blank($state) check does return false because it is given a Filament\Forms\Components\RichEditor\RichContentAttribute.

This fix checks if the $state implements Illuminate\Contracts\Support\Htmlable and uses the rendered html in the blank check instead.

This fixes both NULL and EMPTY values.

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.

@github-project-automation github-project-automation bot moved this to Todo in Roadmap Jan 7, 2026
@SimonBroekaert SimonBroekaert changed the title [4.x] fix - handle Htmlable state in toEmbeddedHtml blank check [4.x] fix - handle Htmlable state in TextEntry toEmbeddedHtml blank check Jan 7, 2026
Copy link
Member

@danharrin danharrin left a comment

Choose a reason for hiding this comment

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

Does the same need to happen for TextColumn?

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Roadmap Jan 7, 2026
@danharrin danharrin added the bug Something isn't working label Jan 7, 2026
@danharrin danharrin added this to the v4 milestone Jan 7, 2026
@SimonBroekaert
Copy link
Contributor Author

SimonBroekaert commented Jan 7, 2026

Does the same need to happen for TextColumn?

Ah yes, the TextColumn can indeed also render the RichContentAttribute. I've tested it on my project and indeed, the placeholder is not rendering there either.

I've updated the PR to also add the change to that blank check.

Thanks! 🙏

@SimonBroekaert SimonBroekaert changed the title [4.x] fix - handle Htmlable state in TextEntry toEmbeddedHtml blank check [4.x] fix - handle Htmlable state in TextEntry/TextColumn toEmbeddedHtml blank check Jan 7, 2026
@danharrin danharrin merged commit 246e4ee into filamentphp:4.x Jan 8, 2026
23 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Roadmap Jan 8, 2026
@SimonBroekaert SimonBroekaert deleted the fix/text-entry-placeholder-with-rich-content-attribute branch January 8, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants