mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Fixed #3512 - DropdownMenu: Disabled dropdown can still be opened with screen reader
This commit is contained in:
parent
c3c3edcde8
commit
df3f1ca5a9
4 changed files with 49 additions and 0 deletions
|
@ -397,6 +397,11 @@ export default {
|
|||
}, 0); // For ScreenReaders
|
||||
},
|
||||
onFocus(event) {
|
||||
if (this.disabled) {
|
||||
// For ScreenReaders
|
||||
return;
|
||||
}
|
||||
|
||||
this.focused = true;
|
||||
this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : this.overlayVisible && this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1;
|
||||
this.overlayVisible && this.scrollInView(this.focusedOptionIndex);
|
||||
|
@ -409,6 +414,12 @@ export default {
|
|||
this.$emit('blur', event);
|
||||
},
|
||||
onKeyDown(event) {
|
||||
if (this.disabled) {
|
||||
event.preventDefault();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const metaKey = event.metaKey || event.ctrlKey;
|
||||
|
||||
switch (event.code) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue