Skip to content

PopupMenuHandler.factoryMethod has a wrong type? #308

@eldonwilliams

Description

@eldonwilliams

Hello

I am trying to extend PopupMenuHandler and override .factoryMethod.

Currently, the signature is .factoryMethod(handler: PopupMenuItem, cell: Cell | null, me: MouseEvent) => void. However, based on everything I can gather, handler should have the type PopupMenuHandler.

My code is below, I am using the latest build.

import { Cell, Graph, PopupMenuHandler, PopupMenuItem } from "@maxgraph/core";

export default class CustomPopupMenuHandler extends PopupMenuHandler {
    constructor(graph: Graph) {
        super(graph);

        this.addItem("Delete", null, function (){});

        // @ts-ignore
        this.factoryMethod = (handler: CustomPopupMenuHandler, cell: Cell, me: MouseEvent) => {
            console.log(handler)
        }
    }
}

Thank you,
Eldon

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions