Repository navigation
fix: adjust language submenu placement and login label - #8227
Merged
Merged
Conversation
shaohuzhang1
commented
Nov 30, 2026
| <MkDropdown class="w-full" trigger="hover" placement="right-start"> | ||
| <div class="flex-between w-full gap-2 py-[5px] px-2"> | ||
| <div class="flex-align-center gap-2"> | ||
| <MkIcon name="icon_internet_outlined" class="text-N600!" /> |
Contributor
Author
There was a problem hiding this comment.
Review of the diff
The change itself is a single token (left-start → right-start) on a nested language submenu. Nothing here is outright broken, but there are several things worth checking.
1. Behavior / correctness
- RTL regression.
right-startis correct for LTR submenus, but this menu exists to switch interface language — so it must also work whendir="rtl"is set (Arabic, Hebrew, etc.). Hardcoding the side means RTL users get a submenu that opens away from the parent item. Derive it from direction:or use the library's:placement="isRTL ? 'left-start' : 'right-start'"
auto/auto-startplacement if available. - Viewport overflow. A right-opening flyout will be clipped when the parent dropdown is anchored near the right edge (e.g. avatar menu at top-right of the header). Make sure flip/shift modifiers or
fallback-placementsare enabled;left-starthad the symmetric problem on the left, so the real fix is probably "let the popper decide" rather than swapping a constant. trigger="hover"+@click.stop. Clicking the row does nothing (hover opens it), which contradicts the@click.stophandler and normal menu expectations. Also a hover submenu needs:- a hover delay / open-close grace period, otherwise diagonal mouse movement from the parent item to the submenu closes it ("diagonal problem");
trigger="click"(or['hover','focus']) for keyboard users.
- Teleport + outside-click ordering. If poppers are teleported to
body, clicking a language option stops propagation to the parent's outside-click handler — verify the parent doesn't close (and cancel the language-change handler) before the selection runs. - Chevron/arrow direction. If the row contains a trailing arrow icon, it likely still points left/right incorrectly now. Not visible in the shown lines — check it.
- Eager rendering. The submenu renders on every dropdown open; consider lazy render on first hover/open if the language list is long.
2. Accessibility
- Hover-only submenus are unusable on touch devices and for keyboard/AT users. Need
role="menu"/role="menuitem",aria-haspopup="menu",aria-expanded, and ArrowRight/Enter to open, ArrowLeft/Escape to close back to the parent item. trigger="hover"typically never updatesaria-expanded, so screen readers get no state feedback.
3. Styling / Tailwind
py-[5px]breaks the 4px spacing rhythm — usepy-1(4px) orpy-1.5(6px).p-0!andtext-N600!(!important) signal specificity conflicts with the component's defaults. Prefer fixing the component defaults or using a proper prop over!important.class="w-full"on the dropdown trigger is fine; if the class lands on the popper it will force a 100%-width panel and can overflow. Verify which element receives it.w-fullon a trigger inside a popper resolves against the popper width, not the menu — fine here, but combined withp-0!on the parent item this is a fragile style coupling. A dedicatedsubmenu/nestedprop onMkDropdownItemwould be cleaner.- No gap/offset between parent item and submenu; the flyout may visually butt against the menu. Add a small offset (e.g.
:offset="[0, 4]").
4. Minor / verification
- The hunk header shows
const goLogin = () => {but the content is an SFC template with<!-- -->comments — git's enclosing-block heuristic is probably wrong here. Double-check the file/line you're patching (a.vuetemplatecan't live inside a JS function). - Changing one attribute silently fixes a layout bug; add a comment or a
placementprop with a sensible default so the next person doesn't flip it back. - No test/Storybook coverage for narrow viewports; a long right-opening language flyout on mobile will exceed the viewport — consider max-height + scroll, or a select/drawer on small screens.
Suggested shape
<MkDropdownItem @click.stop class="!p-0">
<MkDropdown
class="w-full"
trigger="click"
:placement="isRTL ? 'left-start' : 'right-start'"
:fallback-placements="['right-start','left-start','right-end','left-end']"
:offset="[0, 4]"
@click.stop
>
<!-- label + icon; flip the chevron with the placement -->
</MkDropdown>
</MkDropdownItem>(Exact prop names for fallback/offset depend on your popper wrapper.)
Bottom line: the one-line change is probably an improvement, but it should be direction-aware, should not rely on hover alone, and should let the popper flip/shift instead of hardcoding a side.
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.
fix: adjust language submenu placement and login label