Skip to content

Commit 606e120

Browse files
authored
Auto-expand framework frames when one of them is selected (#10606)
1 parent ea84bb2 commit 606e120

File tree

1 file changed

+5
-1
lines changed
  • src/devtools/client/debugger/src/components/SecondaryPanes/Frames

1 file changed

+5
-1
lines changed

src/devtools/client/debugger/src/components/SecondaryPanes/Frames/Group.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export function Group({
4747
disableContextMenu,
4848
panel,
4949
}: GroupProps) {
50-
const [expanded, setExpanded] = useState(false);
5150
const isSelectable = panel == "console";
5251

5352
const { contextMenu, onContextMenu } = useStackFrameContextMenu({
@@ -56,6 +55,11 @@ export function Group({
5655
copyStackTrace,
5756
});
5857

58+
const containsSelectedFrame = group.some(
59+
frame =>
60+
selectedFrameId?.pauseId === frame.pauseId && selectedFrameId?.frameId === frame.protocolId
61+
);
62+
const [expanded, setExpanded] = useState(containsSelectedFrame);
5963
const toggleFrames = (event: React.MouseEvent) => {
6064
event.stopPropagation();
6165
setExpanded(prevExpanded => !prevExpanded);

0 commit comments

Comments
 (0)