Skip to content

bug: Rich text editor initializes on empty-form when using StackedInline and leads to two RTE instances #123

@h-peters

Description

@h-peters

When using a StackedInline the Rich text editor also initializes in an empty-form. When the add-row button is clicked the Editor initializes again and is shown twice.

Image

The selector for the form-row

this._inline_admin_selector = 'body.change-form .form-row';

in combination with the empty-form check
if (document.querySelector(this._inline_admin_selector + '.empty-form')) {
// Marker for inline admin form: do **not** initialize empty form templates
this._admin_selector = this._inline_admin_selector + ':not(.empty-form) ' + this._admin_selector;
}

leads to not updating this._admin_selector
this._admin_selector = 'textarea.CMS_Editor';

The HTML for StackedInline does not match the selector body.change-form .form-row.empty-form
For TabularInline this works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions