Skip to content

fix(SelectPanel): update input fontSize to 16 on small viewports on iOS #6139

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 11 commits into from
May 30, 2025

Conversation

francinelucca
Copy link
Member

@francinelucca francinelucca commented May 29, 2025

Relates to https://github.com/github/primer/issues/5118

iPhones force the screen to zoom in to input when the text is under 16px font size. This PR adds a css media query to make the input font size 16px on narrow screens when on full screen to prevent zoom in on SelectPanel.

Changelog

New

  • css media query to make input font size 16px on narrow screens when on full screen

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented May 29, 2025

🦋 Changeset detected

Latest commit: 5dc4c8f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the staff Author is a staff member label May 29, 2025
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label May 29, 2025
Copy link
Contributor

github-actions bot commented May 29, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 94.49 KB (+0.04% 🔺)
packages/react/dist/browser.umd.js 94.6 KB (+0.13% 🔺)

@francinelucca francinelucca marked this pull request as ready for review May 29, 2025 19:09
@Copilot Copilot AI review requested due to automatic review settings May 29, 2025 19:09
@francinelucca francinelucca requested review from a team as code owners May 29, 2025 19:09
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This patch ensures input elements in SelectPanel use a 16px font size on narrow viewports to prevent iOS from zooming in when text is smaller than 16px.

  • Introduces a fullScreenOnNarrow prop passed through SelectPanel to the filtered list.
  • Extends FilteredActionListWithModernActionList to accept and act on fullScreenOnNarrow.
  • Adds a CSS rule to bump the input’s font size on narrow screens.
  • Updates the changeset for a patch release.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

File Description
packages/react/src/SelectPanel/SelectPanel.tsx Pass fullScreenOnNarrow flag into the list-rendering logic
packages/react/src/FilteredActionList/FilteredActionListWithModernActionList.tsx Add fullScreenOnNarrow prop and conditionally apply the CSS class
packages/react/src/FilteredActionList/FilteredActionList.module.css Define .FullScreenTextInput with a media query for narrow viewports
.changeset/mean-parrots-heal.md Record the patch release and summarise the fix
Comments suppressed due to low confidence (1)

packages/react/src/FilteredActionList/FilteredActionListWithModernActionList.tsx:46

  • The new fullScreenOnNarrow prop introduces visual behavior changes but is not covered by existing tests. Please add unit or Visual Regression tests to confirm the font-size adjustment on narrow viewports.
fullScreenOnNarrow?: boolean

@@ -224,6 +226,7 @@ export function FilteredActionList({
aria-describedby={inputDescriptionTextId}
loaderPosition={'leading'}
loading={loading && !loadingType.appearsInBody}
className={fullScreenOnNarrow ? classes.FullScreenTextInput : ''}
Copy link
Preview

Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

This direct className assignment will override any className provided in textInputProps, potentially dropping existing styling. Consider merging them, for example using clsx(textInputProps.className, fullScreenOnNarrow && classes.FullScreenTextInput).

Copilot uses AI. Check for mistakes.

@github-actions github-actions bot requested a deployment to storybook-preview-6139 May 29, 2025 19:11 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6139 May 29, 2025 19:25 Inactive
@@ -4,3 +4,12 @@
overflow: auto;
flex-grow: 1;
}

.FullScreenTextInput {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, do you need a classname at all since you're gating the change inside a media query?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm using it on js side to only apply it when the SelectPanel is fullscreen so I think yes 👀 . Unless we'd like to always do this? which is fair

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh okay, I wasn't sure if we always wanted to do it for any ios situation 😄

@github-actions github-actions bot requested a deployment to storybook-preview-6139 May 30, 2025 03:46 Abandoned
@francinelucca francinelucca changed the title fix(SelectPanel): update input fontSize to 16 on small viewports fix(SelectPanel): update input fontSize to 16 on small viewports on iOS May 30, 2025
@github-actions github-actions bot requested a deployment to storybook-preview-6139 May 30, 2025 03:56 Abandoned
@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 30, 2025
@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/380690

@primer-integration
Copy link

🟢 golden-jobs completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels May 30, 2025
@francinelucca francinelucca added this pull request to the merge queue May 30, 2025
Merged via the queue into main with commit 091165f May 30, 2025
35 checks passed
@francinelucca francinelucca deleted the fix/selectpanel-zoomin branch May 30, 2025 11:12
@primer primer bot mentioned this pull request May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants