-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
TextControl: Restrict type
prop in TypeScript
#45433
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change seems reasonable to me 🚀 but happy to hear other folks' opinions here
packages/components/CHANGELOG.md
Outdated
@@ -54,6 +54,7 @@ | |||
- `CustomGradientBar`: Refactor away from Lodash ([#45367](https://github.com/WordPress/gutenberg/pull/45367/)). | |||
- `TextControl`: Set Storybook control types on `help`, `label` and `type` ([#45405](https://github.com/WordPress/gutenberg/pull/45405)). | |||
- `Autocomplete`: use Popover's new `placement` prop instead of legacy `position` prop ([#44396](https://github.com/WordPress/gutenberg/pull/44396/)). | |||
- `TextControl`: Restrict `type` prop to `email`, `number`, `password`, `tel`, `text`, `search` or `url` ([#45433](https://github.com/WordPress/gutenberg/pull/45433/)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to move the CHANGELOG entry up to the new Unreleased section
@mirka quick check that you don't see any issues with restricting the values of the |
Nope! Plus they're just type annotations so it would be trivial to update if we need any tweaks. |
ae0f052
to
79189e3
Compare
What?
Update
type
props to only allowemail
,number
,password
,tel
,text
,search
orurl
.Why?
A lot of the default
type
options doesn't make sense to use with theTextControl
component.How?
type
. Types remove are:button
checkbox
color
date
datetime-local
file
hidden
image
month
radio
range
reset
submit
time
week
Testing Instructions
type
from a select control.