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

feat(dia.Paper): custom events on link label #2381

Merged
merged 6 commits into from
Nov 6, 2023

Conversation

MartinKanera
Copy link
Contributor

Description

In case a custom event is bound to the label of the link propagate it, so the appropriate listeners can react to it accordingly.

Related to the changes from #2110.

Motivation and Context

Custom events that were declared on the label of a link like this:

const link = new joint.shapes.standard.Link({
    source: { x: 50, y: 50 },
    target: { x: 300, y: 70 },
    labels: [{
        markup: [
            {
                tagName: 'rect',
                selector: 'labelBody'
            }, {
                tagName: 'text',
                selector: 'labelText'
            }
        ],
        attrs: {
            labelText: {
                text: 'Label',
                pointerEvents: 'none',
            },
            labelBody: {
                ref: 'text',
                width: 'calc(w)',
                height: 'calc(h)',
                fill: '#ffffff',
                stroke: 'black',
                event: 'link:label:pointerdown',
            }
        },
    }]
});

were not triggered after the pointerdown event was executed.

@kumilingus kumilingus merged commit 8d3a09f into clientIO:master Nov 6, 2023
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants