Skip to content

Commit

Permalink
Refactor #3100
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Oct 13, 2022
1 parent 80cf8eb commit dfb29c6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/components/tieredmenu/TieredMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ export default {
if (ObjectUtils.isEmpty(processedItem)) return;
const { index, level, parentKey, items } = processedItem;
const { index, key, level, parentKey, items } = processedItem;
const grouped = ObjectUtils.isNotEmpty(items);
const activeItemPath = this.activeItemPath.filter((p) => p.parentKey !== parentKey);
const activeItemPath = this.activeItemPath.filter((p) => p.parentKey !== parentKey && p.parentKey !== key);
activeItemPath.push(processedItem);
grouped && activeItemPath.push(processedItem);
this.focusedItemInfo = { index, level, parentKey };
this.activeItemPath = activeItemPath;
Expand All @@ -281,15 +281,13 @@ export default {
onItemClick(event) {
const { originalEvent, processedItem } = event;
const grouped = this.isProccessedItemGroup(processedItem);
const root = ObjectUtils.isEmpty(processedItem.parent);
grouped ? this.onItemChange(event) : this.hide(originalEvent, true);
grouped ? this.onItemChange(event) : this.hide(originalEvent, !root);
},
onItemMouseEnter(event) {
if (ObjectUtils.isNotEmpty(this.activeItemPath)) {
const { processedItem } = event;
const grouped = this.isProccessedItemGroup(processedItem);
grouped && this.onItemChange(event);
this.onItemChange(event);
}
},
onArrowDownKey(event) {
Expand Down

0 comments on commit dfb29c6

Please sign in to comment.