pull/2835/head
mertsincan 2022-08-01 02:46:39 +01:00
parent d907b675a0
commit 8271114182
4 changed files with 14 additions and 4 deletions

View File

@ -232,7 +232,7 @@ const DropdownProps = [
type: "string", type: "string",
default: "null", default: "null",
description: "Defines a string value that labels an interactive element." description: "Defines a string value that labels an interactive element."
} },
{ {
name: "ariaLabelledby", name: "ariaLabelledby",
type: "string", type: "string",

View File

@ -160,7 +160,7 @@ const ListboxProps = [
type: "string", type: "string",
default: "null", default: "null",
description: "Defines a string value that labels an interactive element." description: "Defines a string value that labels an interactive element."
} },
{ {
name: "ariaLabelledby", name: "ariaLabelledby",
type: "string", type: "string",

View File

@ -250,7 +250,7 @@ const MultiSelectProps = [
type: "string", type: "string",
default: "null", default: "null",
description: "Defines a string value that labels an interactive element." description: "Defines a string value that labels an interactive element."
} },
{ {
name: "ariaLabelledby", name: "ariaLabelledby",
type: "string", type: "string",

View File

@ -16,7 +16,7 @@
</div> </div>
<Portal :appendTo="appendTo"> <Portal :appendTo="appendTo">
<transition name="p-connected-overlay" @enter="onOverlayEnter" @after-enter="onOverlayAfterEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave"> <transition name="p-connected-overlay" @enter="onOverlayEnter" @after-enter="onOverlayAfterEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave">
<div v-if="overlayVisible" :ref="overlayRef" :style="panelStyle" :class="panelStyleClass" @click="onOverlayClick" v-bind="panelProps"> <div v-if="overlayVisible" :ref="overlayRef" :style="panelStyle" :class="panelStyleClass" @click="onOverlayClick" @keydown="onOverlayKeyDown" v-bind="panelProps">
<a ref="firstHiddenFocusableElementOnOverlay" role="presentation" aria-hidden="true" class="p-hidden-accessible p-hidden-focusable" :tabindex="0" @focus="onFirstHiddenFocus"></a> <a ref="firstHiddenFocusableElementOnOverlay" role="presentation" aria-hidden="true" class="p-hidden-accessible p-hidden-focusable" :tabindex="0" @focus="onFirstHiddenFocus"></a>
<slot name="header" :value="modelValue" :options="visibleOptions"></slot> <slot name="header" :value="modelValue" :options="visibleOptions"></slot>
<div v-if="filter" class="p-dropdown-header"> <div v-if="filter" class="p-dropdown-header">
@ -461,6 +461,16 @@ export default {
target: this.$el target: this.$el
}); });
}, },
onOverlayKeyDown(event) {
switch (event.code) {
case 'Escape':
this.onEscapeKey(event);
break;
default:
break;
}
},
onArrowDownKey(event) { onArrowDownKey(event) {
const optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstFocusedOptionIndex(); const optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstFocusedOptionIndex();