Fixed #5289 - Menu components hover and visual focus updates
parent
b927c604d3
commit
c01a99e48e
|
@ -283,13 +283,24 @@ export default {
|
||||||
|
|
||||||
const { index, level, parentKey, children } = processedOption;
|
const { index, level, parentKey, children } = processedOption;
|
||||||
const grouped = ObjectUtils.isNotEmpty(children);
|
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.dirty = !root;
|
||||||
this.activeOptionPath = activeOptionPath;
|
} 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);
|
grouped ? this.onOptionGroupSelect(originalEvent, processedOption) : this.onOptionSelect(originalEvent, processedOption, isHide);
|
||||||
isFocus && DomHandler.focus(this.$refs.focusInput);
|
isFocus && DomHandler.focus(this.$refs.focusInput);
|
||||||
|
|
Loading…
Reference in New Issue