Skip to content

Problem trying to drag custom component #5507

Answered by artf
brenoassp asked this question in Q&A
Discussion options

You must be logged in to vote

Found myself in a similar situation, will publish in the next release the delegate property.
Here is what it would look like:

const cmpOutType = 'cmp-out';
const cmpInType = 'cmp-in';

editor.Components.addType(cmpOutType, {
  model: {
    defaults: {
      style: { padding: '20px' },
      components: { type: cmpInType },
      draggable: (src, trg) => trg.is('wrapper'),
      delegate: {
        // Select the inner component when trying to select this one
        select: (cmp) => cmp.findType(cmpInType)[0],
      },
    }
  },
});

editor.Components.addType(cmpInType, {
  model: {
    defaults: {
      style: { padding: '5px' },
      components: 'Inner component',
      delegate: {

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by brenoassp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants