-
Notifications
You must be signed in to change notification settings - Fork 823
Forms: add time field #44272
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
base: trunk
Are you sure you want to change the base?
Forms: add time field #44272
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
'jetpack/field-number', | ||
'jetpack/field-date', | ||
'jetpack/field-time', | ||
'jetpack/field-url', |
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.
Alphabetic order
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
@@ -21,12 +21,13 @@ const settings = { | |||
'jetpack/field-multiple-choice', | |||
'jetpack/field-name', | |||
'jetpack/field-number', | |||
'jetpack/field-rating', |
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.
Alphabetic order
Code Coverage SummaryCoverage changed in 5 files.
3 files are newly checked for coverage.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
@@ -689,7 +696,7 @@ public function render_input_field( $type, $id, $value, $class, $placeholder, $r | |||
} | |||
} | |||
|
|||
// this is a hack for Firefox to prevent users from falsly entering a something other then a number into a number field. | |||
// this is a hack for Firefox to prevent users from falsely entering a something other than a number into a number field. |
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.
Unrelated typo fix
@@ -1447,7 +1454,7 @@ public function render_select_field( $id, $label, $value, $class, $required, $re | |||
} | |||
|
|||
/** | |||
* Return the HTML for the email field. | |||
* Return the HTML for the date field. |
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.
Unrelated typo fix
d1e535e
to
b62ff5a
Compare
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.
Yay! I am glad we have this functionality.
It looks a bit odd to have it as a wide-input, but it's not a blocker for release.
Q: do we plan to offer any settings with this?
Some things we could improve (video walkthrough below (I'm using Arc browser)):
Time_picker_PR.mp4 |
I think it is best not to use the ![]() I was looking for a solution to this and found this implementation by Mantine where they use two or more separate text inputs, giving them a control on the input that is not possible with the |
Yep, agreed — we'll likely have a similar problem with other fields like number and some future address fields like zip code where we need to rethink how setting width works on fields. Agreed on UX notes; I noted the same things in the issue earlier as well FORMS-18. I think what we'll do is that try preserve the native input as "style variation" as something site owners can choose to use, but that the default UX is more opinionated. Since this is behind feature flag, I'll merge regardless, and then we can iterate. |
377f23b
to
e7a6ebf
Compare
e7a6ebf
to
84f2342
Compare
Resolves FORMS-18
Adds as a beta block, so this is safe to merge as it won't show up to customers yet.
Uses browser native time input for starters. In a follow-up we might either add another style variation, explore styling the time field better by default, or override it with more custom picker like we do for date field.
Proposed changes:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Then add "time" field to your form.