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

CustomSelect: Add WordPressComponentsProps #56998

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

brookewp
Copy link
Contributor

@brookewp brookewp commented Dec 13, 2023

What?

Part of #55023

Adding WordPressComponentProps for more flexibility in adding props.

Why?

To be able to add HTML attributes to CustomSelect and CustomSelectItem, the child items of CustomSelect. This will also be useful when adapting this to the legacy version.

How?

Adding WordPressComponentProps to inherit html attributes from a div element

Testing Instructions

  1. Add a valid html attribute for a button to CustomSelect i.e. onBlur
  2. Add a valid html attribute for a div to a CustomSelectItem i.e. className
  3. Check there are no type errors and that it renders as expected

@brookewp brookewp added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Dec 13, 2023
@brookewp brookewp requested a review from a team December 13, 2023 01:48
@brookewp brookewp self-assigned this Dec 13, 2023
@brookewp brookewp requested a review from ajitbohra as a code owner December 13, 2023 01:48
Copy link

github-actions bot commented Dec 13, 2023

Flaky tests detected in f5fb013.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7199502214
📝 Reported issues:

@brookewp
Copy link
Contributor Author

I initially thought of just adding to the child CustomSelectItem - however, the legacy CustomSelectControl can include
event handler props so I think that makes sense here too, but as a button rather than a div.

Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to be merged after adding a CHANGELOG entry 🚀

@brookewp brookewp merged commit 59e8958 into trunk Dec 14, 2023
52 checks passed
@brookewp brookewp deleted the add/wordpresscomponentprops-customselectv2 branch December 14, 2023 00:16
@github-actions github-actions bot added this to the Gutenberg 17.4 milestone Dec 14, 2023
artemiomorales pushed a commit that referenced this pull request Jan 4, 2024
* CustomSelectControl v2: Add WordPressComponentsProps

* Add WordPressComponentProps as button to CustomSelect

* Update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
Status: Done 🎉
Development

Successfully merging this pull request may close these issues.

2 participants