keditor
keditor copied to clipboard
[BUG] Can't move container with content
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.
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
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;
}