Dropdown Node

Dropdowns are a common form control that allows the user to select from a list of options.

Users can click on the dropdown to display a list of options, or start typing to fuzzy-find to jump directly to their choice within a larger lists of options.

Dropdowns emit the change event when their selection changes. When disabled, the user will not be able to change the value of a dropdown, and no change events will be emitted.

Properties

Visible

PropdropdownNode.isVisible
Typeboolean
Default{{true}}

Whether or not this node is visible.

Enabled

PropdropdownNode.isEnabled
Typeboolean
Default{{true}}

Whether or not this node is enabled.

Tooltip

PropdropdownNode.tooltip
Typestring
Defaultundefined

The tooltip text to display when hovered or focused over this node.

Top

PropdropdownNode.top
Typestring
Default1

The position of the node from the top side of the grid (grid-row-start).

Left

PropdropdownNode.left
Typestring
Default1

The position of the node from the left side of the grid (grid-column-start).

Width

PropdropdownNode.width
Typestring
Default128px

The width of the node. When this node is in a grid layout, this should be done using unitless grid column units (specifying 4 will become grid-column-end: span 4). When this node is in a stack layout, the width must be specified using CSS units (e.g. 100px or 100%).

Min Width

PropdropdownNode.minWidth
Typestring
Defaultnone

The minimum width of the node. When this node is in a grid layout, this property is ignored.

Max Width

PropdropdownNode.maxWidth
Typestring
Defaultnone

The maximum width of the node. When this node is in a grid layout, this property is ignored.

Height

PropdropdownNode.height
Typestring
Default32px

The height of the node. When this node is in a grid layout, this should be done using unitless grid row units (specifying 4 will become grid-row-end: span 4). When this node is in a stack layout, the height must be specified using CSS units (e.g. 100px or 100%).

Min Height

PropdropdownNode.minHeight
Typestring
Defaultnone

The minimum height of the node. When this node is in a grid layout, this property is ignored.

Max Height

PropdropdownNode.maxHeight
Typestring
Defaultnone

The minimum height of the node. When this node is in a grid layout, this property is ignored.

Overflow

PropdropdownNode.overflow
TypeOverflow ('auto' | 'visible' | 'hidden' | 'scroll')
Defaultauto

The strategy used to handle overflow in the horizontal and vertical axes for content that is larger than its container.

Overflow X

PropdropdownNode.overflowX
TypeOverflow ('auto' | 'visible' | 'hidden' | 'scroll')
Defaultauto

The strategy used to handle overflow in the horizontal axis for content that is larger than its container.

Overflow Y

PropdropdownNode.overflowY
TypeOverflow ('auto' | 'visible' | 'hidden' | 'scroll')
Defaultauto

The strategy used to handle overflow in the vertical axis for content that is larger than its container.

Custom Styles

PropdropdownNode.styles
Typestring
Defaultelement.styles { }

Custom CSS styles to be applied to the node. Use element.styles to refer to the current node.

Label

PropdropdownNode.label
Typestring
Defaultundefined

The label to be displayed alongside the dropdown.

Field Name

PropdropdownNode.formFieldName
Typestring
Defaultundefined

Defines the key for this input in the body of the submitted form.

Values

PropdropdownNode.values
TypeArray<unknown>
Default{{[1, 2, 3]}}

The array of values that the user is able to choose from. Values can be any TypeScript value, including objects. Often, it is useful to display a human-readable string to the user of a dropdown using the displayValues property, and instead use a machine-readable value in this property, such as an ID or row object.

Display Values

PropdropdownNode.displayValues
TypeArray<string>
Defaultundefined

The array of human-readable displayed values that the user is able to choose from. This array should have the same length as values, but must contain only strings.

Value

PropdropdownNode.value
Typeunknown
Defaultundefined

The currently selected value of the dropdown. This will be one of the objects in values, or undefined if no option is selected.

Placeholder

PropdropdownNode.placeholder
Typestring
Defaultundefined

The placeholder value to display when no option has been selected.

Fuzzy Matching

PropdropdownNode.fuzzyMatching
Typeboolean
Default{{true}}

Whether or not to enable fuzzy-find matching of dropdown items when using the keyboard.

Case-sensitive Matching

PropdropdownNode.caseSensitiveMatching
Typeboolean
Default{{false}}

Whether or not to enable case-sensitive matching of dropdown items when using the keyboard.

Required

PropdropdownNode.isRequired
Typeboolean
Default{{false}}

Whether or not this dropdown is required. This is a visual flag that updates the corresponding accessibility properties. It is up to the app developer to enforce the requirement.

Allow Clearing

PropdropdownNode.allowClearing
Typeboolean
Default{{true}}

Whether or not to allow clearing of the dropdown after a selection has been made. This will reset the dropdown's value to undefined.

Label Style

PropdropdownNode.labelStyle
TypeDropdownLabelStyle ('left' | 'top' | 'hidden' | 'right')
Defaultleft

The display style of the label next to the dropdown.

Event Handlers

On Change

HandlerdropdownNode.onChange

Called when the selected dropdown option changes.