-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
CreateTemplatePartModalContents: use native radio inputs #67702
base: trunk
Are you sure you want to change the base?
CreateTemplatePartModalContents: use native radio inputs #67702
Conversation
Size Change: -78 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
aebc4ff
to
74d7f7b
Compare
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
74d7f7b
to
70dd1e7
Compare
packages/fields/src/components/create-template-part-modal/index.tsx
Outdated
Show resolved
Hide resolved
70dd1e7
to
e65ea97
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.
Thanks for the cleanup!
packages/fields/src/components/create-template-part-modal/index.tsx
Outdated
Show resolved
Hide resolved
packages/fields/src/components/create-template-part-modal/index.tsx
Outdated
Show resolved
Hide resolved
packages/fields/src/components/create-template-part-modal/index.tsx
Outdated
Show resolved
Hide resolved
packages/fields/src/components/create-template-part-modal/style.scss
Outdated
Show resolved
Hide resolved
input[type="radio"]:not(:checked) ~ & { | ||
opacity: 0; | ||
} |
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.
😎
By the way I'm getting a "The 'useSelect' hook returns different values when called with the same state and parameters" warning when opening the modal, but confirmed it's already an issue in trunk. |
This caught my attention 🙂 and I believe I have a fix in #67786. Please try to apply the fix and let me know if it eliminates the warning for you. I didn't do much testing myself 🙂 |
I love this idea. #66615 will be a prerequisite for this. |
My preference would be to remove the customization, instead of introducing a new variant. Does this mean that we should stop working on this PR, wait for #66615 and then refactor using |
#67786 landed already, so the warning should disappear after rebasing to the latest |
I'd probably lean towards proceeding with the PR as-is, to avoid changing the shipping UI. We can then revisit the design in a dedicated issue and evaluate:
|
e65ea97
to
34a93cd
Compare
Rebased and addressed all feedback. I'm good with merging this PR and then iterating with a new design in a separate issue. |
What?
Fixes #66569
Refactor the
CreateTemplatePartModalContents
component to use native<input type="radio" />
elements instead of the deprecatedRadioGroup
componentWhy?
The
RadioGroup
component is deprecated and we shouldn't use it in the repository.This refactor brings in other several benefits:
fieldset
andlegend
;How?
fieldset
,legend
,radio
andlabel
)Testing Instructions
trunk
(apart from the differences listed above)Screenshots or screencast
Kapture.2024-12-07.at.00.57.36.mp4
Kapture.2024-12-07.at.01.01.40.mp4