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

Node gets inserted after body tag.. Fix #350

Open
AbdisamadMoh opened this issue May 4, 2024 · 1 comment
Open

Node gets inserted after body tag.. Fix #350

AbdisamadMoh opened this issue May 4, 2024 · 1 comment

Comments

@AbdisamadMoh
Copy link

Node gets inserted after the body tag if you choose insert "AFTER"

image
function addSectionComponent(component, after = true) {
      let node = generateElements(component.html)[0];

      if (after) {
//start
        if (addSectionElement.tagName == "BODY") {
          addSectionElement.append(node);
        } else {
          addSectionElement.after(node);
        }
//end
      } else {
        addSectionElement.append(node);
      }

      if (component.afterDrop) {
        node = component.afterDrop(node);
      }

      node = node;
      self.selectNode(node);
      self.loadNodeComponent(node);
      Vvveb.TreeList.loadComponents();
      Vvveb.TreeList.selectComponent(node);

      Vvveb.Undo.addMutation({
        type: "childList",
        target: node.parentNode,
        addedNodes: [node],
        nextSibling: node.nextSibling,
      });
    }

If the selected node is body insert within the body.

@givanz
Copy link
Owner

givanz commented May 30, 2024

Thanks for the bug report, it was fixed in d575326 add component button is hidden for body.

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