Skip to content

fix(Breadcrumbs): render endContent only once to prevent duplicate events#2630

Open
temrjan wants to merge 1 commit intogravity-ui:mainfrom
temrjan:fix/breadcrumbs-duplicate-end-content
Open

fix(Breadcrumbs): render endContent only once to prevent duplicate events#2630
temrjan wants to merge 1 commit intogravity-ui:mainfrom
temrjan:fix/breadcrumbs-duplicate-end-content

Conversation

@temrjan
Copy link
Copy Markdown

@temrjan temrjan commented Mar 25, 2026

Summary

Fixes #2617endContent is rendered twice in the DOM (once in the visible list, once in the hidden measurer container), causing interactive elements to fire events twice and duplicating data-qa attributes.

Root cause: The measurer <div aria-hidden="true" inert> renders a full copy of endContent for width calculation. Even though the container is hidden, React still mounts the component tree and attaches event handlers.

Fix: Remove endContent from the measurer. It is already tracked via preservedRefs in the visible list (line 58), so useCollapseChildren correctly accounts for its width during collapse calculation.

Test plan

  • Added test: renders endContent only once in the DOM — verifies only one button is found by role
  • All 15 existing Breadcrumbs tests pass
  • ESLint + pre-commit hooks pass

🤖 Generated with Claude Code

…ents

The hidden measurer container rendered a second copy of endContent,
causing interactive elements (buttons, dialogs) to fire events twice
and duplicating data-qa attributes in the DOM.

Remove endContent from the measurer — it is already tracked via
preservedRefs in the visible list, so the collapse calculation
remains correct.

Closes gravity-ui#2617

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@temrjan temrjan requested a review from ValeraS as a code owner March 25, 2026 05:20
@temrjan
Copy link
Copy Markdown
Author

temrjan commented Apr 30, 2026

Hi @ValeraS, just a gentle reminder about this PR. Would appreciate a review when you have a moment, thanks!

@ValeraS
Copy link
Copy Markdown
Collaborator

ValeraS commented Apr 30, 2026

@temrjan Hi, this was fixed here #2647

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.

Breadcrumbs: endContent is rendered twice, duplicating interactive elements and data-qa attributes

2 participants