Contents

ContextMenuItemWithRole

Extends: ContextMenuElement

A context menu item with a predefined role that may perform an action when clicked.

import { ContextMenuItemWithRole } from '@mobrowser/api';

Example 

import { ContextMenu, ContextMenuItemWithRole } from '@mobrowser/api';

const menu = new ContextMenu({
  items: [
    new ContextMenuItemWithRole({ role: 'copy' }),
    'copy'
  ]
})

Properties 

role 

readonly role: ContextMenuItemRole;

The role of the context menu item.

Methods 

constructor() 

constructor(options: ContextMenuItemWithRoleOptions): void;

Creates a new context menu item with a role.

ParameterTypeDescription
optionsContextMenuItemWithRoleOptionsThe options for constructing the context menu item with a role.