Clone remove button instead of creating a new one from scratch

Created on 24 February 2023, over 1 year ago
Updated 11 April 2023, about 1 year ago

Problem/Motivation

When the delete confirmation feature is enabled, the remove action button is replaced by another one to show the confirmation form. This button is created in pure JS so it does not benefit from previous alterations on the main button. This could be useful for some modules/themes that would try to add some attributes or change the button title for example.

Steps to reproduce

  1. Implement hook_paragraphs_widget_actions_alter to add a title on the remove_button button and change its title
  2. Enable the removal confirmation feature

Expected: the remove button has the new title and the title attribute
Current: the remove button has the default title ("Remove") and no title attribute

Proposed resolution

Use JS to clone the existing button instead of creating one from scratch.

✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France DuaelFr Montpellier, France

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024