new Dropdown( name, note, defaultValue, values, onChange [, options ] )

Description

Creates a dropdown using discord's built in dropdown.

Parameters
Name Type Attributes Description
name string

name label of the setting

note string

help/note to show underneath or above the setting

defaultValue *

currently selected value

values Array.<module:Settings~DropdownItem>

array of all options available

onChange callable

callback to perform on setting change, callback item value

options object <optional>

object of options to give to the setting

Name Type Attributes Default Description
clearable boolean <optional>
false

should be able to empty the field value

searchable boolean <optional>
false

should user be able to search the dropdown

disabled boolean <optional>
false

should the setting be disabled

Methods


getElement() → {HTMLElement}

Returns
  • root element for setting

onChange()

Description

Fires onchange to listeners


onAdded()

Description

Fired when root node added to DOM


onRemoved()

Description

Fired when root node removed from DOM