Skip to content

Commit

Permalink
if node already expanded, toggle it off
Browse files Browse the repository at this point in the history
  • Loading branch information
fariss committed Jul 30, 2024
1 parent 62701a2 commit f6bc425
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webui/src/components/RuleMatchesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ const onNodeSelect = (node) => {
const nodeKey = node.key
const nodeType = node.data.type
// If the node is already expanded, collapse it and its children
if (expandedKeys.value[nodeKey]) {
delete expandedKeys.value[nodeKey]
return
}
if (nodeType === 'rule') {
// For rule nodes, clear existing expanded keys and set the clicked rule as expanded
// expand the first (child) match by default
Expand Down

0 comments on commit f6bc425

Please sign in to comment.