Skip to content

Fix TextInput prop types & remove system props - #1414

Merged
jfuchs merged 1 commit into
mainfrom
jfuchs/textinput-types
Sep 9, 2021
Merged

Fix TextInput prop types & remove system props#1414
jfuchs merged 1 commit into
mainfrom
jfuchs/textinput-types

Conversation

@jfuchs

@jfuchsjfuchs commented Sep 8, 2021

Copy link
Copy Markdown
Contributor

This PR should give us a more accurate type for the props of TextInput. Previously the props included:

type TextInputInternalProps = {
// etc
} & ComponentProps<typeof Wrapper> &
ComponentProps<typeof Input>

But that left some props as a messy intersection of types, like onChange (#1377). We can resolve that by explicitly omitting any fields from Input's props that are explicitly destructured from TextInput's props.

Closes#1377

See also #1163

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

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

@jfuchs
jfuchs requested review from a team and colebemisSeptember 8, 2021 19:29
@changeset-bot

changeset-botBot commented Sep 8, 2021

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e6959bd

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

This PR includes changesets to release 1 package
NameType
@primer/componentsMajor

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

@jfuchs

Copy link
Copy Markdown
ContributorAuthor

I've got some tests to fix, but wanted to put up the PR to get feedback on the approach

@github-actions

github-actionsBot commented Sep 8, 2021

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
dist/browser.esm.js48.59 KB (-0.23% 🔽)
dist/browser.umd.js48.85 KB (-0.21% 🔽)

@jfuchs
jfuchsforce-pushed the jfuchs/textinput-types branch from 586d40d to ab7cfb1CompareSeptember 9, 2021 21:19
@jfuchs
jfuchsforce-pushed the jfuchs/textinput-types branch from ab7cfb1 to e6959bdCompareSeptember 9, 2021 21:35

@colebemiscolebemis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@jfuchs
jfuchs merged commit f4e1de6 into mainSep 9, 2021
@jfuchs
jfuchs deleted the jfuchs/textinput-types branch September 9, 2021 22:34
@primer-cssprimer-css mentioned this pull request Sep 9, 2021
Sign up for freeto 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.

Inaccurate type for TextInput's onChange property

2 participants

@jfuchs@colebemis