QuillToolbarDropDown

QuillToolbarDropDown

Class representing a dropdown tool for a Quill Editor toolbar.

Constructor

new QuillToolbarDropDown(optionsopt)

Creates an instance of QuillToolbarDropDown.
Source:
Parameters:
Name Type Attributes Description
options object <optional>
The options/settings for this QuillToolbarDropDown.
Name Type Attributes Default Description
id string <optional>
`dropdown-${random10digitNumber}` The id of the quill tool.
label string <optional>
"" The default label that is being displayed before making a selection.
rememberSelection boolean <optional>
true Automatically change the label to the current selection.
items object <optional>
{} The default items this dropdown will have. Needs to be a key-value-object (key=visible label; value=actual value).

Methods

onSelect(label, value, quill)

A callback that gets called automatically when the dropdown selection changes. This callback is expected to be overwritten.
Source:
Parameters:
Name Type Description
label string The label of the newly selected item.
value string The value of the newly selected item.
quill Quill The quill instance the dropdown tool is attached to.

setItems(items)

Set the items for this dropdown tool.
Source:
Parameters:
Name Type Description
items object Needs to be a key-value-object (key=visible label; value=actual value).

setLabel(newLabel)

Set the label for this dropdown tool and automatically adjust the width to fit the label.
Source:
Parameters:
Name Type Description
newLabel String The new label that should be set.