keditor icon indicating copy to clipboard operation
keditor copied to clipboard

[BUG] Can't move container with content

Open kionez opened this issue 3 years ago • 2 comments

I noticed a ugly bug, also tested in official example with Firefox 87.0 and Chrome 89.

If I use a container with component content (i.e.: "Featured article"), I can't move it anywhere. If I put a component after a container with component, when I try to move it I can't restore his placement.

Here is a short video done on the official example.

kionez avatar Mar 24 '21 09:03 kionez

I'm testing a fix changing src/keditor/container/initContainerContent.js, from:

        items: `> .${CSS_CLASS.COMPONENT}`,
        connectWith: `.${CSS_CLASS.CONTAINER_CONTENT_INNER}`,

to:

        items: `> .${CSS_CLASS.COMPONENT}, > .${CSS_CLASS.SUB_CONTAINER}`,
        connectWith: `.${CSS_CLASS.CONTAINER_CONTENT_INNER}, .${CSS_CLASS.CONTENT_AREA}`,

It seems working, but I don't have the knowledge to understand if it has other consequences

kionez avatar Mar 26 '21 11:03 kionez

I'm testing a fix to avoid too many nested container, addig in src/keditor/container/initContainerContent.js, in the receive function (line 46):

            let target = $(this);
            if (target.parents(`.${CSS_CLASS.CONTAINER_CONTENT_INNER}`).length >= 1) {
                $(ui.sender).sortable("cancel");
                return false;
            }

kionez avatar Mar 31 '21 09:03 kionez