Skip to content

TextEditorField / TrixEditor performance issue with many editors #7611

@dwd-akira

Description

@dwd-akira

I encountered a major frontend performance issue when using many TextEditorField instances on the same EasyAdmin page, especially inside CollectionField.

Problem :

Each TextEditorField immediately instantiates a full Trix editor on page load:

hidden textarea
trix-editor
toolbar
event listeners
undo/redo history
rich DOM/contenteditable handling

With many editors on the page (20+), the browser becomes very heavy when the user starts typing.

Symptoms :

The issue is entirely frontend-side:

typing latency starts immediately after page load
the more editors and content there are, the worse it becomes

The biggest performance hit seems related to:

multiple active contenteditable areas
Trix undo/redo history management
many simultaneously mounted editors

What significantly improved performance :

I implemented a lazy-loading approach for TextEditorField:

page load → render lightweight HTML preview only
focus/click → dynamically create trix-editor
blur → save content and completely destroy the editor + toolbar

So instead of :

20-30 active Trix instances

There is only :

1 active Trix instance at a time

This dramatically improved typing responsiveness.

I also disabled undo/redo history handling for the lazy editors, which further improved performance.

Possible improvement for EasyAdmin :

A LazyTextEditorField class (or option mode) for TextEditorField could probably solve this class of performance problems.

This would especially help pages using :

large forms
collections
multiple rich text editors
long HTML content

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions