-
Notifications
You must be signed in to change notification settings - Fork 843
Forms: use inner blocks for dropdown field #44348
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
|
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. |
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Code Coverage SummaryCoverage changed in 3 files.
6 files are newly checked for coverage. Only the first 5 are listed here.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
fcc31e7 to
a944b04
Compare
| } | ||
| }, | ||
| [ insertBlock, fieldParentId, formParentId, parentIndex ] | ||
| [ insertBlock, fieldParentId, formParentId, parentIndex, defaultBlockName ] |
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.
Looks like we updated this hook to take an extra parameter, but I don't see this used elsewhere in this PR? If we do update this, I think we need to update where we invoke the hook in the input edit.js file here.
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.
Yup I have a few of these that didn't get autofixed but just wanted to push not to lose the work while I was switching branches:
projects/packages/forms/src/blocks/field-select/edit.js
40:8 error 'optionsWrapper' is assigned a value but never used no-unused-vars
86:34 error 'index' is defined but never used no-unused-vars
86:56 error Missing "key" prop for element in iterator react/jsx-key
| } | ||
| ); | ||
|
|
||
| /* |
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.
I assume we can remove this commented out code. Similar for commented code in dropdown/index.js
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.
Thanks! Yep I'm still playing with code so sometimes leaving things as commented, but I'll clean it up at the end.
| setAttributes( { options: _options } ); | ||
| changeFocus( Math.max( index - 1, 0 ), true ); | ||
| }; | ||
|
|
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.
So the select field now leverages dropdown and dropdown option blocks to store options. I was trying to understand backwards compat concerns. In testing, if I create a select dropdown, then update to this branch, my options disappear. So I think we need some kind of migration for existing blocks from the old options structure to the new?
Not sure if something like migrateOptionsToInnnerBlocks() could be adapted here.
fc802cc to
f247b1b
Compare
| display: none; | ||
|
|
||
| p { | ||
| margin-bottom: 10px; |
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.
TODO: use block gap variable?
|
This PR has been marked as stale. This happened because:
If this PR is still useful, please do a [trunk merge or rebase](https://github.com/Automattic/jetpack/blob/trunk/docs/git-workflow.md#keeping-your-branch-up-to-date) and otherwise make sure it's up to date and has clear testing instructions. You may also want to ping possible reviewers in case they've forgotten about it. Please close this PR if you think it's not valid anymore — if you do, please add a brief explanation. If the PR is not updated (or at least commented on) in another month, it will be automatically closed. |
Resolves FORMS-126
Resolves FORMS-194
Related to autocomplete feature which would benefit from customization options for dropdown and easier management of longer lists:
Screen.Recording.2025-07-22.at.17.46.49.mov
Proposed changes:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions: