Issue #3014Opened September 10, 2020by Lerdouille1 reactions

BUG: Move component from Child

Question

Hi,

i'm trying to make custom components composed with other components. No problem to do that. I'm facing an issue when i want to move the whole component.

Here is my test component:

editor.DomComponents.addType('testcomponent', {
        // Model definition
        isComponent: el => {
            if (el.tagName === 'DIV' && (typeof el.dataset.type !== 'undefined' && el.dataset.type== 'testcomponent')) {
              return { type: 'testcomponent'};
            }
        },
        model: {
          // Default properties
            defaults: {
                tagName: 'div',
                attributes: {"data-type": "testcomponent"},
                components: [
                    {
                        resizable: false,
                        draggable: false,
                        droppable: false,
                        selectable: false,
                        hoverable: false,
                        propagate: ['hoverable', 'draggable', 'resizable', 'droppable', 'selectable'],
                        type: 'link',
                        components: 'My link'
                    }
                ]
            }
        }
    });

it looks like this on the editor :

image

my issue is when i want to move the component, i can move it when i click on the blank space after the a href link, but when i want to move it by click/dragging on the link, nothing happen...

I know i put the non selectable parameter on the link component, but is it possible to move it anyway ?

For the record, i can move the whole thing by using the handle "tlb-move"

Thanks !

regards

Answers (3)

LerdouilleSeptember 14, 20201 reactions

Thank you ;)

artfSeptember 14, 20200 reactions

No, it's all as defined. You're trying to drag a non-draggable component so, the behavior is correct

LerdouilleSeptember 14, 20200 reactions

Hi,

thank you for the answer. Well, i know my "link" component is not draggable, i set it that way (to specially not drag the link outside the whole component) But it's also set as non selectable, so if i click on it, and i want to drag the whole thing, we should expect to select the whole component right ?

If not, is there a solution to do so ?

regards

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.