Skip to content
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 doesn't allow date, time, datetime-local types #59544

Closed
cawa-93 opened this issue Mar 4, 2024 · 4 comments
Closed

TextControl doesn't allow date, time, datetime-local types #59544

cawa-93 opened this issue Mar 4, 2024 · 4 comments
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Comments

@cawa-93
Copy link
Contributor

cawa-93 commented Mar 4, 2024

Description

зображення

In fact, this field is fully functional (for the web), but it raises a typescript error.

Step-by-step reproduction instructions

Code with issue:

<TextControl
    label={__('Start Date', 'road')}
    type="datetime"
/>;

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@cawa-93 cawa-93 added the [Type] Bug An existing feature does not function as intended label Mar 4, 2024
@t-hamano
Copy link
Contributor

t-hamano commented Mar 4, 2024

Thanks for the report.

This type restriction was added in #45433, but since it is just an annotation, it seems possible to specify types that are not allowed. I think this issue can be considered an improvement that expands the available types.

P.S. datatime does not seem to exist as a type that can be used in the input element.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components and removed [Type] Bug An existing feature does not function as intended labels Mar 4, 2024
@cawa-93 cawa-93 changed the title TextControl doesn't allow date, datetime, time types TextControl doesn't allow date, time types Mar 4, 2024
@mirka mirka changed the title TextControl doesn't allow date, time types TextControl doesn't allow date, time, datetime-local types Mar 7, 2024
@mirka
Copy link
Member

mirka commented Mar 7, 2024

Yes, it seems reasonable to allow these date/time types.

@mirka mirka added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Mar 7, 2024
@dphyled
Copy link

dphyled commented Mar 7, 2024

Dibs! :D

@mirka
Copy link
Member

mirka commented Mar 12, 2024

Closed by #59666

@mirka mirka closed this as completed Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants