Filter all context menu items (standard and custom) through
`isActionEnabled`.
This commit is contained in:
parent
f86d0f9102
commit
9e5948ac28
@ -6240,6 +6240,19 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
private getContextMenuItems = (
|
private getContextMenuItems = (
|
||||||
type: "canvas" | "element" | "custom",
|
type: "canvas" | "element" | "custom",
|
||||||
source?: string,
|
source?: string,
|
||||||
|
): ContextMenuItems => {
|
||||||
|
const options = this._getContextMenuItems(type, source);
|
||||||
|
return options.filter(
|
||||||
|
(item) =>
|
||||||
|
!item ||
|
||||||
|
item === CONTEXT_MENU_SEPARATOR ||
|
||||||
|
this.actionManager.isActionEnabled(item, { guardsOnly: true }),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
private _getContextMenuItems = (
|
||||||
|
type: "canvas" | "element" | "custom",
|
||||||
|
source?: string,
|
||||||
): ContextMenuItems => {
|
): ContextMenuItems => {
|
||||||
const options: ContextMenuItems = [];
|
const options: ContextMenuItems = [];
|
||||||
this.actionManager
|
this.actionManager
|
||||||
|
Loading…
x
Reference in New Issue
Block a user