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

UnregisterBehaviour bug #475

Open
toczekmj opened this issue Sep 30, 2024 · 1 comment
Open

UnregisterBehaviour bug #475

toczekmj opened this issue Sep 30, 2024 · 1 comment

Comments

@toczekmj
Copy link

toczekmj commented Sep 30, 2024

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)

var options = new BlazorDiagramOptions
        {
            LinksLayerOrder = 10,
            NodesLayerOrder = 10,
            AllowMultiSelection = true,
            Zoom =
            {
                Enabled = true,
                Minimum = 0.3,
            },
            Links =
            {
                DefaultRouter = new NormalRouter(),
                DefaultPathGenerator = new SmoothPathGenerator()
            },
        };

        var diagram = new BlazorDiagram(options);

And this is the overwriten version:

var options = new BlazorDiagramOptions
        {
            LinksLayerOrder = 10,
            NodesLayerOrder = 10,
            AllowMultiSelection = true,
            Zoom =
            {
                Enabled = true,
                Minimum = 0.3,
            },
            Links =
            {
                DefaultRouter = new NormalRouter(),
                DefaultPathGenerator = new SmoothPathGenerator()
            },
        };

        var diagram = new BlazorDiagram(options);
        diagram.UnregisterBehavior<SelectionBehavior>();
        diagram.RegisterBehavior(new SelectionBehavior(diagram));

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.

@toczekmj
Copy link
Author

@FlaviusAugustus

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

1 participant