The MarkupEditor logo

Class: Dropdown

Dropdown()

A drop-down menu, displayed as a label with a downwards-pointing triangle to the right of it.

Modified from: prosemirror-menu

Constructor

Create a dropdown wrapping the elements. The following options are available:

Type Property Description
boolean indicator Whether an indicator triangle should be shown, default true.
Function(EditorState): string titleUpdate Function to execute that returns a label based on state.
Function(): boolean enable Function to return true if MenuItem is enabled, else false
string label The string to show in the MenuItem
KeymapConfig keymap The KeymapConfig to use for the MenuItem
Command run The Command to run when the item is pressed
Function(): boolean active Function to return true if MenuItem is active, else false.
object attrs Node attrs that can be used within the enable or active functions.

Classes

Dropdown

Methods

render(view)

Render the dropdown menu and sub-items.

Parameters:
Name Type Description
view EditorView

The EditorView to render this DropDown in.

Table of contents