File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/view/results Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { selectableZebraStripe } from "./result-table-utils";
55import { ScrollIntoViewHelper } from "./scroll-into-view-helper" ;
66import { AlertTablePathNodeRow } from "./AlertTablePathNodeRow" ;
77import { AlertTableDropdownIndicatorCell } from "./AlertTableDropdownIndicatorCell" ;
8+ import { useMemo } from "react" ;
89
910interface Props {
1011 path : Sarif . ThreadFlow ;
@@ -35,7 +36,14 @@ export function AlertTablePathRow(props: Props) {
3536 scroller,
3637 } = props ;
3738
38- const pathKey = { resultIndex, pathIndex } ;
39+ const pathKey = useMemo (
40+ ( ) => ( { resultIndex, pathIndex } ) ,
41+ [ pathIndex , resultIndex ] ,
42+ ) ;
43+ const handleDropdownClick = useMemo (
44+ ( ) => toggler ( [ pathKey ] ) ,
45+ [ pathKey , toggler ] ,
46+ ) ;
3947
4048 const isPathSpecificallySelected = Keys . equalsNotUndefined (
4149 pathKey ,
@@ -51,7 +59,7 @@ export function AlertTablePathRow(props: Props) {
5159 </ td >
5260 < AlertTableDropdownIndicatorCell
5361 expanded = { currentPathExpanded }
54- onClick = { toggler ( [ pathKey ] ) }
62+ onClick = { handleDropdownClick }
5563 />
5664 < td className = "vscode-codeql__text-center" colSpan = { 3 } >
5765 Path
You can’t perform that action at this time.
0 commit comments