-
Notifications
You must be signed in to change notification settings - Fork 213
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
UnregisterBehaviour bug #475
Comments
Hello, I will check this out! |
Hey, I found why this happens:
When you add back the selection behavior last, its events are AFTER the drag movables on, which means that it will try to move the previously selected element and then select the newly clicked one. To fix this, I have added a new parameter in the constructor of var diagram = new BlazorDiagram(options, registerDefaultBehaviors: false);
diagram.RegisterBehavior(new SelectionBehavior(diagram)); // or yours
diagram.RegisterBehavior(new DragMovablesBehavior(diagram));
diagram.RegisterBehavior(new DragNewLinkBehavior(diagram));
diagram.RegisterBehavior(new PanBehavior(diagram));
diagram.RegisterBehavior(new ZoomBehavior(diagram));
diagram.RegisterBehavior(new EventsBehavior(diagram));
diagram.RegisterBehavior(new KeyboardShortcutsBehavior(diagram));
diagram.RegisterBehavior(new ControlsBehavior(diagram));
diagram.RegisterBehavior(new VirtualizationBehavior(diagram)); For now this should unblock you, but I'm not very happy with the fact that users need to know all the default behaviors and their orders, I'll see if I can think of a better solution or maybe you guys have a suggestion! |
Hi.
Today I've experienced weird bug related to overwriting existing selection behavior.
Our app seems to work fine while using default settings (example below)
Working.edited.-.Made.with.Clipchamp.mp4
But when we overwrite selection behaviour either with the default one, or with custom implementation, cards starts to behave unexpectedly. Namely in order to move a particular card we need to double click it, otherwise previously selected card is being moved. Example below:
Not.working.edited.-.Made.with.Clipchamp.mp4
This os our diagram configuration (working version, without overwriting default behavior)
And this is the overwriten version:
It seems like some event is not being disposed while unregistering the behavior, but we really have no idea what is going on. Hope someone will help us.
The text was updated successfully, but these errors were encountered: