-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Experiment: DataForm Modal Type #71212
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
@@ -258,9 +279,15 @@ const CombinedFieldsComponent = ( { | |||
'filesize', | |||
'dimensions', | |||
'tags', | |||
{ | |||
id: 'combined_address', |
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.
Does it matter that this is a unique ID not defined in the post? We're generating the content from other values.
Size Change: +706 B (+0.04%) Total Size: 1.92 MB
ℹ️ View Unchanged
|
This is inconsistent with almost every other Modal instance. I’m not quite following the reasoning for disabling this behavior. When a modal has a dedicated close button (as is the case here) I think it’s reasonable to expect that clicking outside the modal will close it. |
@jameskoster Does clicking outside of a modal "apply" or "cancel" changes? Apply would be safest to avoid discarding wanted changes. But its not explicit. |
I’d vote for consistency with other modals where clicking outside is the same as clicking close or cancel. |
b195587
to
e3e552e
Compare
@jameskoster I've added size |
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
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. |
Flaky tests detected in 181eeed. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/16993831021
|
What?
This PR adds a
modal
panel type. Enabled by settingpanelType
fromdropdown
tomodal
.On edit, controls are presented in a modal. There is local state to prevent onChange firing right away. onChange is triggered when you click the
apply
button. If you cancel or clickx
changes are discarded. Clicking outside of the modaldoes nothing as we want to user to use one of the CTAcancels any changes.On top of this, I wanted to include a way to control the data presented for combined fields so you can present a set of data in a unique way. I've included this example in Storybook:
This is a combined field made up of 3 simple fields with a custom
content
prop. When you edit this you see:Note some of this code was created by AI agent. I've reviewed and tweaked where appropriate. The
content
prop addition was hand coded.Why?
How?
content
propTesting Instructions
?path=/story/dataviews-dataform--combined-fields&args=panelType:modal;labelPosition:top