Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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]: Using graph.findModelsUnderElement(cell) with lables positioned outside the rectangle cell #2405

Closed
ROYopedia opened this issue Nov 24, 2023 · 0 comments
Labels

Comments

@ROYopedia
Copy link

What happened?

Hello,
we are using jointjs+ and I have one scenario where while dragging I am validating where the cell should avoid overlapping.
I have taken code reference from validators.js from planogram demo app of yours.

Now it is working fine in general with below code

export const doesShelfOverlap = (graph, cell) => {
    return graph.findModelsUnderElement(cell).length > 0;
};

But I have some labels which is positioned outside of my custom element. In this case the graph.findModelsUnderElement(cell).length > 0; is not able to detect overlapping models under it as only labels touching the other cells.
Please refer to the below image where label of second rect is overlapping to the first rectangle.
image

Any suggestion you can give to handle the situation.

Version

3.7

What browsers are you seeing the problem on?

Firefox, Chrome, Android (State browser in description)

What operating system are you seeing the problem on?

Linux

@ROYopedia ROYopedia added the bug label Nov 24, 2023
@clientIO clientIO locked and limited conversation to collaborators Nov 24, 2023
@kumilingus kumilingus converted this issue into discussion #2406 Nov 24, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

1 participant