Refactor
parent
d907b675a0
commit
8271114182
|
@ -232,7 +232,7 @@ const DropdownProps = [
|
|||
type: "string",
|
||||
default: "null",
|
||||
description: "Defines a string value that labels an interactive element."
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "ariaLabelledby",
|
||||
type: "string",
|
||||
|
|
|
@ -160,7 +160,7 @@ const ListboxProps = [
|
|||
type: "string",
|
||||
default: "null",
|
||||
description: "Defines a string value that labels an interactive element."
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "ariaLabelledby",
|
||||
type: "string",
|
||||
|
|
|
@ -250,7 +250,7 @@ const MultiSelectProps = [
|
|||
type: "string",
|
||||
default: "null",
|
||||
description: "Defines a string value that labels an interactive element."
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "ariaLabelledby",
|
||||
type: "string",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</div>
|
||||
<Portal :appendTo="appendTo">
|
||||
<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>
|
||||
<slot name="header" :value="modelValue" :options="visibleOptions"></slot>
|
||||
<div v-if="filter" class="p-dropdown-header">
|
||||
|
@ -461,6 +461,16 @@ export default {
|
|||
target: this.$el
|
||||
});
|
||||
},
|
||||
onOverlayKeyDown(event) {
|
||||
switch (event.code) {
|
||||
case 'Escape':
|
||||
this.onEscapeKey(event);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
onArrowDownKey(event) {
|
||||
const optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstFocusedOptionIndex();
|
||||
|
||||
|
|
Loading…
Reference in New Issue