Skip to content

fix: vertically center dropdown label#1490

Merged
doradocodes merged 5 commits into
processing:v1from
lirenjie95:fix/dropdown-label-vertical-center
Jul 14, 2026
Merged

fix: vertically center dropdown label#1490
doradocodes merged 5 commits into
processing:v1from
lirenjie95:fix/dropdown-label-vertical-center

Conversation

@lirenjie95

@lirenjie95 lirenjie95 commented Jul 1, 2026

Copy link
Copy Markdown
Member

Fixes #1482

Problem

In the collapsed Language / Accessibility dropdowns, the icon and caret are position: absolute (manually offset to look centered), but the label is a normal in-flow <span> and .selected had no vertical centering — so the label sat too high relative to the icon and caret.

Fix

Flex-center the button's in-flow content in src/components/Dropdown/styles.module.scss:

.selected {
  display: flex;
  align-items: center;
}

Because the icon and caret are absolutely positioned (out of flow), only the label is affected — the already-aligned icon and caret don't move.

Testing

Verified in the browser that the label is now vertically centered with the icon and caret (tablet/desktop breakpoints and the expanded dropdown state).

Screenshot

screenshot

@doradocodes

Copy link
Copy Markdown
Contributor

@lirenjie95 We tested the fix and the label looks vertically centered now! I think you could also remove the absolute positioning on the icons as well, and readjust the spacing. Thanks!

@lirenjie95

lirenjie95 commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@doradocodes Done — the collapsed dropdown now uses a flex row instead of absolute positioning, so the icon, label and chevron align automatically. Kept the change minimal and left the expanded list as-is. Pushed in the latest commit.

@doradocodes

Copy link
Copy Markdown
Contributor

@lirenjie95 One more thing: I realized that all the items in the dropdown also have the same issue. Could you also apply the same fix to the items?
Screenshot 2026-07-03 at 11 52 52 PM

Comment thread src/components/Dropdown/styles.module.scss Outdated
@lirenjie95 lirenjie95 force-pushed the fix/dropdown-label-vertical-center branch from e506600 to bf71698 Compare July 6, 2026 01:09
@lirenjie95

Copy link
Copy Markdown
Member Author

@doradocodes Good catch — applied the same flex layout to the dropdown items as well. The icon and label in each option are now vertically centered.

@lirenjie95

Copy link
Copy Markdown
Member Author

Also ported this change to main in #1500

@doradocodes

Copy link
Copy Markdown
Contributor

@lirenjie95 I saw that the flexbox change was applied to the dropdown items as well, but I noticed that there was still a small misalignment that didn't fully allow the items to be vertically centered. Looking into it, I saw it was caused by the label being a <button> wrapped in a <span>. Locally, I applied display: flex; align-items: center; to the .option button selector in the styles.module.css and it is now fully vertically aligned.

Here's a side-by-side comparison:
Screenshot 2026-07-10 at 12 01 04 PM

With the extra display:flex; applied:
Screenshot 2026-07-10 at 12 00 32 PM

So I think you can add that display: flex; align-items: center; to the .option button selector and this PR will be good to go!

@lirenjie95 lirenjie95 force-pushed the fix/dropdown-label-vertical-center branch from 56dcee5 to 5cc4002 Compare July 11, 2026 07:53
@lirenjie95

Copy link
Copy Markdown
Member Author

Added for both #1490 and #1500. Thank you for the advice! @doradocodes

@doradocodes doradocodes merged commit 1d7ab84 into processing:v1 Jul 14, 2026
7 checks passed
doradocodes added a commit that referenced this pull request Jul 14, 2026
…center-main

fix: vertically center dropdown label (port #1490 to main)
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.

The "Language" and "Accessibility" dropdowns are not vertically centered

3 participants