8000 Fix vertical alignment of filter checkboxes in search modal by Copilot · Pull Request #657 · readthedocs/addons · GitHub
[go: up one dir, main page]

Skip to content

Conversation

Copy link
Copilot AI commented Dec 4, 2025

Filter checkboxes in the search modal were not vertically centered with their labels, creating a misaligned appearance.

Changes

  • Added vertical-align: middle to .filters li input to center checkboxes with their labels
  • Added cursor: pointer to filter labels
:host > div .filters li input {
  vertical-align: middle;
}

:host > div .filters li label {
  padding: 3px;
  cursor: pointer;
}

This approach uses standard CSS alignment instead of flexbox to avoid potential spacing issues when elements wrap on mobile viewports.

Screenshots

Before:

After:

Original prompt

Fix the display of the filters to ensure the checkbox is vertically centered and not overlapping with the bounding box.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 4, 2025 22:16
Co-authored-by: ericholscher <25510+ericholscher@users.noreply.github.com>
Changed filter list items from inline-block to inline-flex with align-items: center
to properly vertically center checkboxes with their labels. Also added cursor: pointer
to labels for better UX.

Co-authored-by: ericholscher <25510+ericholscher@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix checkbox display issue in filters Fix vertical alignment of filter checkboxes in search modal Dec 4, 2025
Copilot AI requested a review from ericholscher December 4, 2025 22:20
@ericholscher ericholscher marked this pull request as ready for review December 4, 2025 22:21
@ericholscher ericholscher requested review from a team and humitos as code owners December 4, 2025 22:21
src/search.css Outdated

:host > div .filters li {
display: inline-block;
display: inline-flex;
Copy link
Contributor
@agjohnson agjohnson Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching this to flex shouldn't be required. Flex will introduce other spacing issues, like vertical spacing when elements wrap on mobile viewports.

vertical-align: middle on the input is the same effect.

Image

However, normally checkboxes are baseline aligned, not middle aligned. It looks normal to me on Firefox -- the checkbox is aligned with the text baseline:

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agjohnson I'm not sure how to take this feedback? The screenshots above show the issue -- what is the change that fixes it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what's the fix here either, but I can reproduce the issue that Eric is trying to fix in Firefox as well. I don't know if this is the correct way or not, but this PR fixes the issue locally to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to take this feedback?

I'm saying this shouldn't switch to flex, all that is needed is an alignment change. Using flex has other alignment side effects.

The screenshots above show the issue

The first screenshot does not, it shows the same alignment as this PR. This is using vertical-align: middle on the input.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot address this feedback.

Copy link
Member
@ericholscher ericholscher Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first screenshot does not, it shows the same alignment as this PR. This is using vertical-align: middle on the input.

I'm not sure what exactly you're saying? This PR doesn't touch an input, but this issue with the checkbox is what I'm trying to fix:

Screenshot 2025-12-16 at 9 16 56 AM

It seems obviously broken to me?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to use vertical-align: middle on the input element instead of flexbox in commit d850639.

After fix

Changed from display: inline-flex to display: inline-block with
vertical-align: middle on the input element. This avoids potential
wrapping issues on mobile viewports while still achieving proper
vertical alignment of checkboxes with their labels.

Co-authored-by: ericholscher <25510+ericholscher@users.noreply.github.com>
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.

4 participants

0