Skip to main content

blockly > ContextMenuRegistry > ActionRegistryItem

ContextMenuRegistry.ActionRegistryItem interface

A representation of a normal, clickable menu item in the registry.

Signature:

interface ActionRegistryItem extends CoreRegistryItem

Extends: CoreRegistryItem

Properties

Property

Modifiers

Type

Description

associatedKeyboardShortcut?

string

(Optional) Identifier used to associate this context menu item with a keyboard shortcut which will be displayed in the menu as a hint. Should correspond to the name under which a keyboard shortcut that performs the same action as this menu item is registered.

callback

(scope: Scope, menuOpenEvent: Event, menuSelectEvent: Event, location: Coordinate) => void

displayText

((p1: Scope) => string | HTMLElement) | string | HTMLElement

preconditionFn

(p1: Scope, menuOpenEvent: Event) => string

separator?

never

(Optional)