mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
Fixed #5289 - Menu components hover and visual focus updates
This commit is contained in:
parent
b927c604d3
commit
c01a99e48e
1 changed files with 15 additions and 4 deletions
|
@ -283,13 +283,24 @@ export default {
|
|||
|
||||
const { index, level, parentKey, children } = processedOption;
|
||||
const grouped = ObjectUtils.isNotEmpty(children);
|
||||
const root = ObjectUtils.isEmpty(processedOption.parent);
|
||||
const selected = this.isSelected(processedOption);
|
||||
|
||||
const activeOptionPath = this.activeOptionPath.filter((p) => p.parentKey !== parentKey);
|
||||
if (selected) {
|
||||
const { index, key, level, parentKey } = processedOption;
|
||||
|
||||
activeOptionPath.push(processedOption);
|
||||
this.focusedOptionInfo = { index, level, parentKey };
|
||||
this.activeOptionPath = this.activeOptionPath.filter((p) => key !== p.key && key.startsWith(p.key));
|
||||
|
||||
this.focusedOptionInfo = { index, level, parentKey };
|
||||
this.activeOptionPath = activeOptionPath;
|
||||
this.dirty = !root;
|
||||
} else {
|
||||
const activeOptionPath = this.activeOptionPath.filter((p) => p.parentKey !== parentKey);
|
||||
|
||||
activeOptionPath.push(processedOption);
|
||||
|
||||
this.focusedOptionInfo = { index, level, parentKey };
|
||||
this.activeOptionPath = activeOptionPath;
|
||||
}
|
||||
|
||||
grouped ? this.onOptionGroupSelect(originalEvent, processedOption) : this.onOptionSelect(originalEvent, processedOption, isHide);
|
||||
isFocus && DomHandler.focus(this.$refs.focusInput);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue