Skip to content

fix(search): scroll only results#1548

Open
TGianella wants to merge 1 commit into
mdn:mainfrom
TGianella:fix/1474-search-modal-scroll-results
Open

fix(search): scroll only results#1548
TGianella wants to merge 1 commit into
mdn:mainfrom
TGianella:fix/1474-search-modal-scroll-results

Conversation

@TGianella
Copy link
Copy Markdown
Contributor

Description

Change the results row size from min-content to 1fr in the search modal.

Motivation

min-content was causing the grid track to be as high as the whole ul containing the search results, so the ul itself couldn't be a scroll container because its content wasn't overflowing its height. Hence the next parent (dialog) with a capped width became the scroll container and the whole dialog scrolled (with the input field).

1fr fixes that by having the grid track never be higher than the available height up to the max-height of dialog so content can overflow the ul and it becomes a scroll container. 🎉

I also don't think the track height behaves differently when the search results are not long enough to overflow. Because the dialog has no intrinsic height the results row fits the height of the content so there isn't empty space at the bottom of the dialog.

Additional details

Related issues and pull requests

Closes #1474

@TGianella TGianella marked this pull request as ready for review May 7, 2026 15:28
@TGianella TGianella requested a review from a team as a code owner May 7, 2026 15:28
@TGianella TGianella requested a review from LeoMcA May 7, 2026 15:28
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

8f6e22a was deployed to: https://fred-pr1548.review.mdn.allizom.net/

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.

Wrong section scrolls in search results

2 participants