Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Move component from Child #3014

Closed
Lerdouille opened this issue Sep 10, 2020 · 4 comments
Closed

BUG: Move component from Child #3014

Lerdouille opened this issue Sep 10, 2020 · 4 comments

Comments

@Lerdouille
Copy link

Lerdouille commented Sep 10, 2020

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

@artf
Copy link
Member

artf commented Sep 13, 2020

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

@artf artf closed this as completed Sep 13, 2020
@Lerdouille
Copy link
Author

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

@artf
Copy link
Member

artf commented Sep 14, 2020

Ah... sorry, I've realized only now what is going on, I'll fix it in the next release

@artf artf reopened this Sep 14, 2020
@Lerdouille
Copy link
Author

Thank you ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants