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

Hide close or remove button ( 'X' ) for first dragged node. #707

Open
Co-Maheshh opened this issue Jun 6, 2023 · 2 comments
Open

Hide close or remove button ( 'X' ) for first dragged node. #707

Co-Maheshh opened this issue Jun 6, 2023 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@Co-Maheshh
Copy link

Kindly help me to add restriction so that user cannot delete first dragged node.
Have a look in the code tried this but its not working.

mythis.editor.on("nodeRemoved", (id) => {
if(id == 0){
this.toast.error("Cannot remove")
return false;
}
})

@Co-Maheshh Co-Maheshh changed the title Hello jerosoler Hide close or remove button ( 'X' ) for first dragged node. Jun 6, 2023
@jerosoler jerosoler self-assigned this Jun 6, 2023
@jerosoler jerosoler added the question Further information is requested label Jun 6, 2023
@RodrigoSester
Copy link

you can set a display: none; in the drawflow-delete class.

in my case I used the nodeMoved event to change the value of my css variable

JS

this.editor.on("nodeMoved", function() {
  document.documentElement.style.setProperty('--dfDeleteDisplay', 'none');
});

CSS

:root {
  --dfDeleteDisplay: 'block';
}

.drawflow-delete {
  display: --dfDeleteDisplay;
}

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

No branches or pull requests

3 participants