In Fronted editing "is_changed" class not added when deleting paragraphs

Created on 21 July 2025, 10 days ago

Problem/Motivation

When using frontend editing functionality, when adding, dragging, etc, the class "is_changed" is added to the wrapper of the paragraph. But when you delete a paragraph the class "is_changed" is not added.

Steps to reproduce

Add a few paragraphs to a node and save.
Edit again and remove a paragraph and the class is not added.
The trigger that add "is_changed" are the following:

// Add class "is_changed" when the builder is edited.
    const events = [
      'lpb-component:insert.lpb',
      'lpb-component:update.lpb',
      'lpb-component:move.lpb',
      'lpb-component:drop.lpb',
    ].join(' ');
    $element.on(events, (e) => {
      $(e.currentTarget).addClass('is_changed');
    });

Proposed resolution

Add to the const events the delete one:

// Add class "is_changed" when the builder is edited.
    const events = [
      'lpb-component:insert.lpb',
      'lpb-component:update.lpb',
      'lpb-component:move.lpb',
      'lpb-component:drop.lpb',
      'lpb-component:delete.lpb',
    ].join(' ');
    $element.on(events, (e) => {
      $(e.currentTarget).addClass('is_changed');
    });
🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇳🇱Netherlands e.escribano

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024