-
Notifications
You must be signed in to change notification settings - Fork 833
Forms: add first/last name field variations #45517
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?
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?
|
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. |
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.
LGTM, works as expected
Code Coverage Summary1 file is newly checked for coverage.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
UX wise: I'm wondering if we should have just two variations: "Name and "First- and last name", and just render two inputs side-by-side by default? 🤔 Considering if that would be easier for user although with cost of some flexibility that approach in this PR allows. cc @ilonagl too about UX. |
From the UX side it might be good to explore using toggles. Kind of like we do for the phone field. |
@enejb although it might be useful to get the block-inserter visibility that comes with variations? |
I assume we'd insert them as first/last, but we'd really be inserting two different name field variations? So the two fields could be managed separately for settings, moved separately, etc? I'd personally keep it simple and just keep them separate. It's not too hard to add two fields. It allows for flexibility - people will always do thing you don't expect with features in WordPress. It keeps the code simple.
Would these be variations that you can switch between, or a single field where you update a toggle, or maybe both (ie, variations that vary by toggle)? As @Mikael noted, I do think it would be good to have something that can be found/inserted as a first/last name. And I think we should consider adding or updating some of our form patterns to include the first and last name variations. Worth noting you can 'toggle' between first/last name using block transform. I think on balance, I say we go with simple variations. Meets all needs, allows flexibility, easy to add/switch, and skips any extra complexity. |
It would be a single input that would be expanded to include the different "fields". This is how currently the gravity forms does it and I think it works well. See https://docs.gravityforms.com/name/. |
I see. Nice! But does add extra complexity. So question is whether it's worth it vs separate fields. I'd probably opt to keep it simple and do separate fields. But happy to go whichever way we decide. I'll wait and see how convo unfolds. |
a0603fd
to
00613ba
Compare
Fixes FORMS-293
Proposed changes:
Add first and last name variations to the name field with the field HTML ID attribute to set to first-name and last-name.
First/name fiels are generally useful - many forms have first/last name - but this also helps with integrations. Many integrations (MailPoet, Hostinger, plus MailChimp in the future) depend on having identifiable first and last name. Right now we look for "First Name" and "Last Name" labels, which are very English-centric, or users must manually add first-name or last-name ids.
A user can insert these, and they will automatically sync to MailPoet and Hostinger first/last fields.
Other information:
Jetpack product discussion
See linear issue above.
Does this pull request change what data or activity we track or use?
No.
Testing instructions: