fix(Breadcrumbs): render endContent only once to prevent duplicate events#2630
Open
temrjan wants to merge 1 commit intogravity-ui:mainfrom
Open
fix(Breadcrumbs): render endContent only once to prevent duplicate events#2630temrjan wants to merge 1 commit intogravity-ui:mainfrom
temrjan wants to merge 1 commit intogravity-ui:mainfrom
Conversation
…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>
Author
|
Hi @ValeraS, just a gentle reminder about this PR. Would appreciate a review when you have a moment, thanks! |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2617 —
endContentis rendered twice in the DOM (once in the visible list, once in the hidden measurer container), causing interactive elements to fire events twice and duplicatingdata-qaattributes.Root cause: The measurer
<div aria-hidden="true" inert>renders a full copy ofendContentfor width calculation. Even though the container is hidden, React still mounts the component tree and attaches event handlers.Fix: Remove
endContentfrom the measurer. It is already tracked viapreservedRefsin the visible list (line 58), souseCollapseChildrencorrectly accounts for its width during collapse calculation.Test plan
renders endContent only once in the DOM— verifies only one button is found by role🤖 Generated with Claude Code