close
Skip to content

ToggleControl: Pass full props to the input element#74956

Merged
oandregal merged 2 commits intoWordPress:trunkfrom
SirLouen:patch/74952-alt
Feb 4, 2026
Merged

ToggleControl: Pass full props to the input element#74956
oandregal merged 2 commits intoWordPress:trunkfrom
SirLouen:patch/74952-alt

Conversation

@SirLouen
Copy link
Member

Alternative to #74952

Why?

#74952 solves the problem as form validation requires sync processing.

But ultimately the problem is that required is not being passed in first place. Why not passing?

Maybe I'm missing something, but this was the first thing that came to my mind when I saw this trouble

Testing Instructions

Copied/pasted from #74952

  • Open Storybook at ?path=/story/dataviews-dataform--validation&args=layout:card-collapsible
  • Open the "Boolean Fields" card, then close it — badge shows "2 fields need attention"
  • Reopen the card — verify the Toggle error message now appears (on trunk it does not)
  • Verify checkbox and toggle group errors still display correctly
  • Toggle the control on/off to confirm it still functions

@SirLouen SirLouen requested a review from ajitbohra as a code owner January 27, 2026 00:06
@github-actions github-actions bot added the [Package] Components /packages/components label Jan 27, 2026
@github-actions
Copy link

github-actions bot commented Jan 27, 2026

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: SirLouen <sirlouen@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@SirLouen SirLouen added the [Type] Bug An existing feature does not function as intended label Jan 27, 2026
Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

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

Thank you for working on this @SirLouen. I did not tried this fix because I wrongly assumed if we were not passing the prop, and using some reference hack to inject it, there was some reason, well that does not seems to be case 😅
It seems like this fix is working well I'm not noticing regressions, so I think we should probably merge this fix instead of mine. Just going to cc @mirka in case there is additional context.

@oandregal oandregal requested a review from mirka January 27, 2026 12:22
@oandregal oandregal added the [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond label Jan 27, 2026
Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the fix! Please add a changelog before merging.

Copy link
Member

@oandregal oandregal left a comment

Choose a reason for hiding this comment

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

Works nicely, thanks @SirLouen (missing changelog entry in dataviews for CI test to pass

Screen.Recording.2026-02-03.at.17.13.13.mov

@oandregal oandregal enabled auto-merge (squash) February 4, 2026 09:30
@oandregal oandregal merged commit 7fca41f into WordPress:trunk Feb 4, 2026
39 checks passed
@github-actions github-actions bot added this to the Gutenberg 22.6 milestone Feb 4, 2026
@ntsekouras ntsekouras mentioned this pull request Feb 5, 2026
8 tasks
@stokesman
Copy link
Contributor

I’m now seeing warnings in the console for the deprecated __nextHasNoBottomMargin on ToggleControl in a plugin of mine. I tested reverting the commit from this PR and they go away. It seems that was unintentional in this PR but I am uncertain if it qualifies as a fix or regression.

@mirka
Copy link
Member

mirka commented Feb 6, 2026

@stokesman Sorry about that! Fix in #75296.

@SirLouen SirLouen deleted the patch/74952-alt branch February 6, 2026 14:42
MaggieCabrera pushed a commit that referenced this pull request Feb 10, 2026
Co-authored-by: SirLouen <sirlouen@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants