Repository navigation
fix: close other dropdowns when one is opened - #643
Open
kripa-sindhu-007 wants to merge 1 commit into
Open
kripa-sindhu-007 wants to merge 1 commit into
kripa-sindhu-007 wants to merge 1 commit into
Conversation
kripa-sindhu-007
force-pushed
the
fix/dropdown-close-sibling-dropdowns
branch
from
October 11, 2026 12:18
d1a5928 to
6a9f179
Compare
Every DropDown subscribes to the module-level dropDownOpened subject and closes itself when a different dropdown is published to it, but open() never published, so the subscription never fired and opening one dropdown left the others open. The document click handler cannot cover this case: the anchor calls stopPropagation(), so a click on a sibling anchor never reaches it. Clicking anywhere else still closes the dropdowns, which is why only sibling anchor clicks were affected. Signed-off-by: Kripa Sindhu <mail@kripasindhu.dev>
kripa-sindhu-007
force-pushed
the
fix/dropdown-close-sibling-dropdowns
branch
from
November 21, 2026 05:52
6a9f179 to
bd3edf8
Compare
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
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.
Opening a DropDown leaves every other open DropDown on the page open. Reported downstream as argoproj/argo-cd#30112, where the four filters in Argo CD's sync operation panel (HEALTH / STATUS / HOOK / MESSAGE) all stack up on top of each other.
Cause
The coordination mechanism already exists here, it just never fires. Every instance subscribes to the module-level dropDownOpened subject and closes itself when a different dropdown is published to it:
argo-ui/src/components/dropdown/dropdown.tsx
Line 65 in 0b596a0
But dropDownOpened.next(...) is never called anywhere in the repo ; open() only sets its own state, so nothing is ever published and no sibling is ever notified.
The document click handler can't cover this case either: the anchor calls event.stopPropagation(), so a click on a sibling anchor never reaches it. Clicking anywhere neutral does close the dropdowns, which is why only sibling anchor clicks were affected.
Fix
One line in open(), publishing the instance that just opened so the existing subscription can do its job.
Verification
Before / after:
Note on #641
#641 fixes a different symptom in this file — clicking an open dropdown's own anchor to close it — by routing the anchor through a new toggle(). This change lands inside open() and doesn't touch the anchor handler, so the two are complementary rather than competing; whichever merges second should apply cleanly. I kept the test helper inline rather than adding a shared one, to avoid colliding with the isOpened helper #641 introduces.
AI assistance
Claude Code was used while investigating and preparing this change. I've verified the behaviour myself against a real Argo CD instance as described above, I understand every line, and I'll be answering review personally.