Skip to content

Make horizontal padding relative to device width #20047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2025

Conversation

Aditi-1400
Copy link
Contributor

@Aditi-1400 Aditi-1400 commented Jun 30, 2025

The fixed -400px horizontal offset used by
scrollIntoView led to horizontal scroll only moving part-way right on narrow screens. The highlights near the right-edge remained partly or completely offscreen. This can be observed by searching for words on the far-right of the screen on devices with small screens on both Firefox and Chrome.

This centres the highlighted match on any viewport width while clamping the left margin to 20-400px. On very narrow screens the scroll bar now moves all the way to the right instead of stopping midway

Note: Since the minimum width of mainContainer is set to 350px, the scrolling into view still doesn't work right for viewports less than 350px on desktop.

@Aditi-1400 Aditi-1400 force-pushed the fix-horizontal-scroll branch from 6a6c68a to d929aff Compare June 30, 2025 11:54
The fixed -400px horizontal offset used by
scrollIntoView led to horizontal scroll only moving
part-way right on narrow screens. The highlights near
the right-edge remained party or completely off
screen.

This centres the highlighted match on any viewport width while
clamping the left margin to 20-400px. On very narrow screens
the scrollbar now moves all the way to the right instead of
stopping midway.
@calixteman
Copy link
Contributor

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 1

Live output at: http://54.193.163.58:8877/c6c827a1914a3ce/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/b90a69d5b950b66/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/b90a69d5b950b66/output.txt

Total script time: 13.86 mins

  • Integration Tests: FAILED

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/c6c827a1914a3ce/output.txt

Total script time: 26.74 mins

  • Integration Tests: FAILED

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you.

@calixteman calixteman merged commit fd87e66 into mozilla:master Jul 3, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants