fix: prevent product menu staying active after dropdown closes#3071
fix: prevent product menu staying active after dropdown closes#3071Sumanth0718 wants to merge 1 commit into
Conversation
Greptile SummaryThis PR fixes a visual bug where the Products nav trigger button remained styled in the accent color after its dropdown was dismissed — caused by the browser returning focus to the trigger for accessibility reasons, which matched the
Confidence Score: 5/5A one-line Tailwind class swap with no logic changes; the fix is well-scoped and the rest of the component is untouched. The change correctly narrows the focus style from any focus event to keyboard-only focus, which is the standard accessibility pattern. No other component behavior is affected, and the mobile submenu counterpart (ProductsMobileSubmenu.svelte) does not have the same class so it is unaffected. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix: prevent products menu trigger from ..." | Re-trigger Greptile |
Problem
The Product menu trigger remained in the active (accent/red) state even after the dropdown menu was closed.
Root Cause
The trigger button used
focus:text-accent. When the dropdown closed, browser focus returned to the trigger button for accessibility reasons, causing the button to remain styled as active.Fix
Replaced
focus:text-accentwithfocus-visible:text-accent.This ensures:
Testing