diff --git a/src/components/dropdown/Dropdown.vue b/src/components/dropdown/Dropdown.vue index 2533af666..60f9281be 100644 --- a/src/components/dropdown/Dropdown.vue +++ b/src/components/dropdown/Dropdown.vue @@ -43,21 +43,21 @@ export default { props: { value: null, options: Array, + optionLabel: null, + scrollHeight: { + type: String, + default: '200px' + }, + filter: Boolean, + filterPlaceholder: String, + editable: Boolean, + placeholder: String, + disabled: Boolean, dataKey: null, - filter: Boolean, - optionLabel: null, + showClear: Boolean, + tabindex: String, optionValue: null, - optionDisabled: null, - disabled: Boolean, - tabindex: String, - editable: Boolean, - placeholder: String, - showClear: Boolean, - scrollHeight: { - type: String, - default: '200px' - }, - filterPlaceholder: String + optionDisabled: null }, data() { return { diff --git a/src/views/dropdown/DropdownDemo.vue b/src/views/dropdown/DropdownDemo.vue index d9bfdfef9..1215973c9 100644 --- a/src/views/dropdown/DropdownDemo.vue +++ b/src/views/dropdown/DropdownDemo.vue @@ -16,12 +16,6 @@
Dropdown requires a value to bind, optionLabel and a collection of options. How to define the options property; Providing an array of arbitrary objects along with the optionLabel property to specify the field name of the option.
+Common pattern is providing an empty option as the placeholder when using native selects, however Dropdown has built-in support using the placeholder option so it is suggested to use it instead of creating an empty option.
+ +Options can be filtered using an input field in the overlay by enabling the filter property.
+ +Label of an option is used as the display text of an item by default, for custom content support define an item template that gets the option instance as a parameter and returns the content.
+Name | +Type | +Default | +Description | +
---|---|---|---|
value | +any | +null | +Value of the component. | +
options | +array | +null | +An array of selectitems to display as the available options. | +
optionLabel | +string | +null | +Name of the label field of an option when an arbitrary objects instead of SelectItems are used as options. | +
scrollHeight | +string | +200px | +Height of the viewport in pixels, a scrollbar is defined if height of list exceeds this value. | +
filter | +boolean | +false | +When specified, displays an input field to filter the items on keyup. | +
filterPlaceholder | +string | +null | +Placeholder text to show when filter input is empty. | +
editable | +boolean | +false | +When present, custom value instead of predefined options can be entered using the editable input field. | +
placeholder | +string | +null | +Default text to display when no option is selected. | +
disabled | +boolean | +false | +When present, it specifies that the component should be disabled. | +
dataKey | +string | +null | +A property to uniquely match the value in options for better performance. | +
showClear | +boolean | +false | +When enabled, a clear icon is displayed to clear the value. | +
tabindex | +number | +null | +Index of the element in tabbing order. | +
optionValue | +string | +null | +??? | +
optionDisabled | +boolean | +null | +??? | +
Name | +Parameters | +Description | +
---|---|---|
change | +event.originalEvent: Original event + event.value: Selected option value |
+ Callback to invoke on value change | +
input | +event: Input field value | +Callback to invoke on input event of input field (editable mode). | +
Following is the list of structural style classes, for theming classes visit
Name | +Element | +
---|---|
p-dropdown | +Container element. | +
p-dropdown-label | +Element to display label of selected option. | +
p-dropdown-trigger | +Icon element. | +
p-dropdown-panel | +Icon element. | +
p-dropdown-items-wrapper | +Wrapper element of items list. | +
p-dropdown-items | +List element of items. | +
p-dropdown-item | +An item in the list. | +
p-dropdown-filter-container | +Container of filter input. | +
p-dropdown-filter | +Filter element. | +
p-dropdown-open | +Container element when overlay is visible. | +
None.
+