Skip to content

onAction callback for customButtons does not trigger "design:updated" event #467

@AlexPo91

Description

@AlexPo91

When using customButtons, content updated via the onAction callback updates visually but does not trigger the design:updated event. This prevents the builder from recognizing changes automatically, so a workaround (like adding an empty character) is currently needed to save updates.

customButtons: [
  {
    name: 'my_button',
    text: 'Gifs',
    icon: 'image',
    onSetup: () => {},
    onAction: (data, callback) => {
      handleOpenGiphyModal({ data, callback });
    },
  },
];



const handleUpdate = (url) => {
  callback(
    `${data.text}
      <div>
        <img
          src="${url}"
          width="300"
          height="300"
        />
      </div>`
  );
};

Expected Behavior:
Whenever content is updated through a custom button’s onAction callback, the design:updated event should be emitted so the builder automatically recognizes and saves changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions