From 0552ee12685bf5906ebb0c6ab50d76adcca14f28 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Fri, 29 Jul 2022 01:56:40 +0100 Subject: [PATCH] Update DropdownDoc.vue --- src/views/dropdown/DropdownDoc.vue | 356 ++++++++++++++++++++++++----- 1 file changed, 301 insertions(+), 55 deletions(-) diff --git a/src/views/dropdown/DropdownDoc.vue b/src/views/dropdown/DropdownDoc.vue index 39ca3119f..700815f27 100755 --- a/src/views/dropdown/DropdownDoc.vue +++ b/src/views/dropdown/DropdownDoc.vue @@ -119,7 +119,7 @@ export default {
Properties
-

Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.

+

Any property of HTMLDivElement are passed to the main container element. Following are the additional properties to configure the component.

@@ -239,12 +239,6 @@ export default { - - - - - - @@ -252,10 +246,52 @@ export default { - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -264,24 +300,6 @@ export default { - - - - - - - - - - - - - - - - - - @@ -299,6 +317,60 @@ export default { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
false When enabled, a clear icon is displayed to clear the value.
tabindexnumbernullIndex of the element in tabbing order.
inputId stringIdentifier of the underlying input element.
ariaLabelledByinputStyleanynullInline style of the input field.
inputClass string nullEstablishes relationships between the component and label(s) where its value should be one or more element IDs.Style class of the input field.
inputPropsobjectnullUses to pass all properties of the HTMLInputElement/HTMLSpanElement to the focusable input element inside the component.
panelStyleanynullInline style of the overlay panel.
panelClassstringnullStyle class of the overlay panel.
panelPropsobjectnullUses to pass all properties of the HTMLDivElement to the overlay panel inside the component.
filterInputPropsobjectnullUses to pass all properties of the HTMLInputElement to the filter input inside the component.
clearIconPropsobjectnullUses to pass all properties of the HTMLElement to the clear icon inside the component.
appendToA valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are "body" for document body and "self" for the element itself.
emptyFilterMessagestringNo results foundText to display when filtering does not return any results. Defaults to value from PrimeVue locale configuration.
emptyMessagestringNo results foundText to display when there are no options available. Defaults to value from PrimeVue locale configuration.
panelClassstringnullStyle class of the overlay panel.
loading booleanobject null Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it.
autoOptionFocusbooleantrueWhether to focus on the first visible or selected element when the overlay panel is shown.
filterMessagestring{0} results are availableText to be displayed in hidden accessible field when filtering returns any results. Defaults to value from PrimeVue locale configuration.
selectionMessagestring{0} items selectedText to be displayed in hidden accessible field when options are selected. Defaults to value from PrimeVue locale configuration.
emptySelectionMessagestringNo selected itemText to be displayed in hidden accessible field when any option is not selected. Defaults to value from PrimeVue locale configuration.
emptyFilterMessagestringNo results foundText to be displayed when filtering does not return any results. Defaults to value from PrimeVue locale configuration.
emptyMessagestringNo results foundText to be displayed when there are no options available. Defaults to value from PrimeVue locale configuration.
tabindexnumber0Index of the element in tabbing order.
ariaLabelstringnullDefines a string value that labels an interactive element.
ariaLabelledbystringnullEstablishes relationships between the component and label(s) where its value should be one or more element IDs.
@@ -322,9 +394,14 @@ export default { Callback to invoke on value change. - input + focus event - Callback to invoke on value change. + Callback to invoke when the component receives focus. + + + blur + event + Callback to invoke when the component loses focus. before-show @@ -346,16 +423,6 @@ export default { - Callback to invoke when the overlay is hidden. - - focus - event - Callback to invoke when the component receives focus. - - - blur - event - Callback to invoke when the component loses focus. - filter event.originalEvent: Original event
@@ -384,7 +451,7 @@ export default { hide - - + isFocus: Decides whether to focus on the component. Default value is false. Hides the overlay. @@ -401,21 +468,15 @@ export default { - - option - option: Option instance
- index: Index of the option - - - optiongroup - option: OptionGroup instance
- index: Index of the option group - value value: Value of the component
placeholder: Placeholder prop value + + indicator + - + header value: Value of the component
@@ -426,6 +487,16 @@ export default { value: Value of the component
options: Displayed options + + option + option: Option instance
+ index: Index of the option + + + optiongroup + option: OptionGroup instance
+ index: Index of the option group + emptyfilter - @@ -444,10 +515,6 @@ export default { loader options: Options of the loader items for virtualscroller - - - indicator - - @@ -501,13 +568,192 @@ export default { Filter element. - p-dropdown-open + p-overlay-open Container element when overlay is visible.
+
Accessibility
+
Screen Reader
+

Value to describe the component can either be provided with aria-labelledby or aria-label props. The dropdown element has a combobox role + in addition to aria-haspopup and aria-expanded attributes. If the editable option is enabled aria-autocomplete is also added. + The relation between the combobox and the popup is created with aria-controls and aria-activedescendant attribute is used + to instruct screen reader which option to read during keyboard navigation within the popup list.

+

The popup list has an id that refers to the aria-controls attribute of the combobox element and uses listbox as the role. Each list item has an option role, an id to match the aria-activedescendant of the input element along with aria-label, aria-selected and aria-disabled attributes.

+ +

If filtering is enabled, filterInputProps can be defined to give aria-* props to the filter input element.

+

+<span id="dd1">Options</span>
+<Dropdown aria-labelledby="dd1" />
+
+<Dropdown aria-label="Options" />
+
+
+ +
Closed State Keyboard Support
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyFunction
tabMoves focus to the dropdown element.
spaceOpens the popup and moves visual focus to the selected option, if there is none then first option receives the focus.
enterOpens the popup and moves visual focus to the selected option, if there is none then first option receives the focus.
down arrowOpens the popup and moves visual focus to the selected option, if there is none then first option receives the focus.
up arrowOpens the popup and moves visual focus to the selected option, if there is none then last option receives the focus.
any printable characterOpens the popup and moves focus to the option whose label starts with the characters being typed, if there is none and dropdown is not editable then first option receives the focus.
+
+ +
Popup Keyboard Support
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyFunction
tabMoves focus to the next focusable element in the popup. If there is none, the focusable option is selected and the overlay is closed then moves focus to next element in page.
shift + tabMoves focus to the previous focusable element in the popup. If there is none, the focusable option is selected and the overlay is closed then moves focus to next element in page.
enterSelects the focused option and closes the popup, then moves focus to the dropdown element.
spaceSelects the focused option and closes the popup, then moves focus to the dropdown element.
escapeCloses the popup, then moves focus to the dropdown element.
down arrowMoves focus to the next option, if there is none then visual focus does not change.
up arrowMoves focus to the previous option, if there is none then visual focus does not change.
alt + up arrowSelects the focused option and closes the popup, then moves focus to the dropdown element.
left arrowIf the dropdown is editable, removes the visual focus from the current option and moves input cursor to one character left.
right arrowIf the dropdown is editable, removes the visual focus from the current option and moves input cursor to one character right.
homeIf the dropdown is editable, moves input cursor at the end, if not then moves focus to the first option.
endIf the dropdown is editable, moves input cursor at the beginning, if not then moves focus to the last option.
pageUpJumps visual focus to first option.
pageDownJumps visual focus to last option.
any printable characterMoves focus to the option whose label starts with the characters being typed if dropdown is not editable.
+
+ +
Filter Input Keyboard Support
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyFunction
down arrowMoves focus to the next option, if there is none then visual focus does not change.
up arrowMoves focus to the previous option, if there is none then visual focus does not change.
left arrowRemoves the visual focus from the current option and moves input cursor to one character left.
right arrowRemoves the visual focus from the current option and moves input cursor to one character right.
homeMoves input cursor at the end, if not then moves focus to the first option.
endMoves input cursor at the beginning, if not then moves focus to the last option.
enterCloses the popup and moves focus to the dropdown element.
escapeCloses the popup and moves focus to the dropdown element.
tabMoves focus to the next focusable element in the popup. If there is none, the focusable option is selected and the overlay is closed then moves focus to next element in page.
+
+
Dependencies

None.