Skip to content

fix(logs): Prevent cell action menu clicks from toggling row visibility#111717

Merged
JoshuaKGoldberg merged 2 commits intomasterfrom
JoshuaKGoldberg/fix/copy-clipboard-toggles-log-row
Mar 27, 2026
Merged

fix(logs): Prevent cell action menu clicks from toggling row visibility#111717
JoshuaKGoldberg merged 2 commits intomasterfrom
JoshuaKGoldberg/fix/copy-clipboard-toggles-log-row

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Mar 27, 2026

The dropdown menu renders in a React portal, so its DOM lives outside the row. This adds a DOM containment check: before toggling, verify event.currentTarget.contains(event.target). Portal-originating events fail this check since their DOM subtree is separate from the row's.

Fixes LOGS-638

Made with Cursor

@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 27, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 27, 2026
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the JoshuaKGoldberg/fix/copy-clipboard-toggles-log-row branch from 9b419cf to 6011b9d Compare March 27, 2026 16:34
Clicking "Copy to clipboard" (or any item) in the ellipsis dropdown
menu on a log row also toggled the row's expanded/collapsed state.

The dropdown menu renders in a React portal, but React propagates
synthetic events from portals through the component tree. The row's
onPointerUp handler checked isInsideButton(event.target) to skip
the toggle, but portal menu items render as <li role="menuitem">,
which didn't match the button check.

Add a DOM containment guard: verify the event target is actually
inside the row element before toggling. Portal-originating events
fail this check since their DOM is in a separate subtree.

Refs LOGS-638
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>

Made-with: Cursor
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the JoshuaKGoldberg/fix/copy-clipboard-toggles-log-row branch from 6011b9d to bc25c6d Compare March 27, 2026 16:35
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review March 27, 2026 16:51
@JoshuaKGoldberg JoshuaKGoldberg requested a review from a team as a code owner March 27, 2026 16:51
Comment thread static/app/views/explore/logs/tables/logsTableRow.spec.tsx Outdated
@JoshuaKGoldberg JoshuaKGoldberg merged commit a7cd4d8 into master Mar 27, 2026
78 of 80 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the JoshuaKGoldberg/fix/copy-clipboard-toggles-log-row branch March 27, 2026 17:36
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants