Skip to content

Disabling an entry gives " Cannot read property 'data' of null" #740

Open
@crystalfp

Description

@crystalfp

I'm using 3.0.0-beta.2 inside Chrome.
To update the enabled/disabled status of an entry of the menu the only solution I have found is to put a

disable: (): boolean => {
	return projectStatus === "ACTIVE";
}

in the entry and then have:

events: {
	show: (): boolean => {
		$.contextMenu("update");
		return true;
}

But when I open the menu the following error appears:

ContextMenuOperations.js:488 Uncaught TypeError: Cannot read property 'data' of null
    at HTMLUListElement.<anonymous> (ContextMenuOperations.js:488)
    at Function.each (jquery.min.js:2)
    at S.fn.init.each (jquery.min.js:2)
    at e.value (ContextMenuOperations.js:487)
    at e.value (ContextMenuOperations.js:521)
    at ContextMenu.js:278
    at Array.forEach (<anonymous>)
    at e.value (ContextMenu.js:277)
    at e.value (ContextMenu.js:53)
    at Function.c [as contextMenu] (contextmenu.js:34)
(anonymous) @ ContextMenuOperations.js:488
each @ jquery.min.js:2
each @ jquery.min.js:2
value @ ContextMenuOperations.js:487
value @ ContextMenuOperations.js:521
(anonymous) @ ContextMenu.js:278
value @ ContextMenu.js:277
value @ ContextMenu.js:53
c @ contextmenu.js:34
show @ prj-list.ts:143
value @ ContextMenuOperations.js:36
value @ ContextMenuEventHandler.js:100
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2

Is this the correct way or there is another method to be used to enable/disable an entry (and change the name, but this is the next step).
Thanks for looking!
mario

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions