Skip to content

Conversation

@dipree
Copy link
Contributor

@dipree dipree commented Nov 23, 2023

Closes https://github.com/github/primer/issues/2889

The current focus styling for textarea and input in Primer is using box-shadow with inset and it changes the border-color to achieve what visually looks like a 2px focus "outline".

That doesn't account for scrollbars and renders artifacts in the corners because it's two adjacent 1px lines.

Primer Textarea in Firefox

Aside from the visual fixes of the solution in this PR, the one difference is that the additional 1px outline on focus is now outside instead of inside. This behaviour is already being used in the CommentBox.

Changelog

  • Avoid potential scrollbars overlapping the border of the Textarea component
  • Remove border radius fragments of Textarea, TextInput, TextInputWithTokens and Select componentn when focused
  • Retain the box-shadow inset on focus
  • Avoid text overlapping the 1px box-shadow inset on focus when scrolling

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan

Testing & Reviewing

The changes have been tested amongst browsers under macOS and Windows.

TextArea

Firefox:

Before After

Edge:

Before After

Safari:

Before After

TextInput

Before After

TextInputWithTokens

Before After

Select

Before After

Merge checklist

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@changeset-bot
Copy link

changeset-bot bot commented Nov 23, 2023

⚠️ No Changeset found

Latest commit: 8a155eb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 23, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 104.35 KB (+0.02% 🔺)
dist/browser.umd.js 104.88 KB (+0.02% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-3965 November 23, 2023 15:05 Inactive
@github-actions
Copy link
Contributor

Uh oh! @dipree, the image you shared is missing helpful alt text. Check your pull request body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

6 similar comments
@github-actions
Copy link
Contributor

Uh oh! @dipree, the image you shared is missing helpful alt text. Check your pull request body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

@github-actions
Copy link
Contributor

Uh oh! @dipree, the image you shared is missing helpful alt text. Check your pull request body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

@github-actions
Copy link
Contributor

Uh oh! @dipree, the image you shared is missing helpful alt text. Check your pull request body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

@github-actions
Copy link
Contributor

Uh oh! @dipree, the image you shared is missing helpful alt text. Check your pull request body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

@github-actions
Copy link
Contributor

Uh oh! @dipree, the image you shared is missing helpful alt text. Check your pull request body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

@github-actions
Copy link
Contributor

Uh oh! @dipree, the image you shared is missing helpful alt text. Check your pull request body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

@dipree dipree added the skip changeset This change does not need a changelog label Nov 23, 2023
@dipree dipree marked this pull request as ready for review November 23, 2023 17:24
@dipree dipree requested review from a team and mperrotti November 23, 2023 17:24
@dipree dipree changed the title Adjust focus styling Adjust focus styling of textarea and input Nov 23, 2023
@github-actions
Copy link
Contributor

Uh oh! @dipree, the image you shared is missing helpful alt text. Check your pull request body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

@dipree dipree added this pull request to the merge queue Nov 29, 2023
Merged via the queue into main with commit c4216ef Nov 29, 2023
@dipree dipree deleted the dipree/textarea-input-focus-updates branch November 29, 2023 10:28
joshblack added a commit that referenced this pull request Dec 1, 2023
github-merge-queue bot pushed a commit that referenced this pull request Dec 1, 2023
* Revert "Adjust focus styling of `textarea` and `input` (#3965)"

This reverts commit c4216ef.

* chore: add changeset

---------

Co-authored-by: Josh Black <[email protected]>
@dipree dipree restored the dipree/textarea-input-focus-updates branch December 3, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants