Skip to content

perf(DataTable): keep the focused bulk action observer across renders - #8797

Open
nemo-crypto wants to merge 1 commit into
primer:mainfrom
nemo-crypto:nemo/bulk-actions-observer-lifecycle
Open

nemo-crypto wants to merge 1 commit into
primer:mainfrom
nemo-crypto:nemo/bulk-actions-observer-lifecycle

Conversation

@nemo-crypto

Copy link
Copy Markdown
Contributor

Closes #8715.

Problem

TableBulkActions reconnects a document-wide MutationObserver on every render while an action has focus. Keep the observer subscribed until focus moves or the component unmounts, while refreshing the focus return callback after each render.

Verification

Added a Chromium regression for an unrelated rerender followed by child-only removal. It verifies a single observer registration and invokes the latest focus return callback. The bulk actions suite passed (23 tests).

@nemo-crypto
nemo-crypto requested a review from a team as a code owner November 19, 2026 06:54
@nemo-crypto
nemo-crypto requested a review from jonrohan November 19, 2026 06:54
@changeset-bot

changeset-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 87e2939

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataTable: TableBulkActions re-creates a MutationObserver on document.body every render

1 participant