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

Component RadioControl stop to working in WP 5.8.1 #35107

Closed
rubengc opened this issue Sep 24, 2021 · 8 comments
Closed

Component RadioControl stop to working in WP 5.8.1 #35107

rubengc opened this issue Sep 24, 2021 · 8 comments
Labels
[Package] Components /packages/components

Comments

@rubengc
Copy link

rubengc commented Sep 24, 2021

Hi there!

From latest update, the RadioControl component stop to working and its value never gets updated.

I'm using the "selected" attribute which was working completely fine until this update.

Is there any change made in 5.8.1 to this component?

I checked the WP docs and seems the attributes still the same as I was using from the release of Gutenberg so I do not know exactly what's happening...

@Mamaduka
Copy link
Member

Hi, @rubengc

Can you share an example code for testing?

@Mamaduka Mamaduka added [Package] Components /packages/components [Status] Needs More Info Follow-up required in order to be actionable. labels Sep 24, 2021
@rubengc
Copy link
Author

rubengc commented Sep 24, 2021

Hi @Mamaduka

Of course, I found it in my plugin GamiPress, every control (checkboxes, even a multicheckboxes we created) is working fine except the RadioControl

Here is a test website with GamiPress installed where you can test it in any post editor:
https://tastewp.com/new/?pre-installed-plugin-slug=gamipress

The steps to reproduce are:
1 - Create a post
2 - Add the block Single Achievement
3 - Try to change the "Layout" or "Alignment" option (both are RadioControl)

The thing is that I have not updated this code in months, and was working completely fine until 5.8.1:
https://github.com/rubengc/GamiPress-Gutenberg-Blocks/blob/master/src/block/block.js#L278-L284

Hope we can find a way to get it fixed :)

@rubengc
Copy link
Author

rubengc commented Oct 4, 2021

Hi @Mamaduka any news about this?

This issue seems extremely strange and I just did a test to rollback to WordPress 5.7.9 where this control works perfectly, seems that issue was introduced in version 5.8 and above

@github-actions
Copy link

Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Oct 20, 2021
@rubengc
Copy link
Author

rubengc commented Oct 20, 2021

I added more info here: #35107 (comment)

@github-actions github-actions bot removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Oct 21, 2021
@github-actions
Copy link

github-actions bot commented Nov 6, 2021

Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Nov 6, 2021
@rubengc
Copy link
Author

rubengc commented Nov 8, 2021

Can anyone review this?

@Mamaduka Mamaduka added Needs Testing Needs further testing to be confirmed. and removed [Status] Needs More Info Follow-up required in order to be actionable. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. labels Nov 8, 2021
@t-hamano
Copy link
Contributor

t-hamano commented Aug 5, 2022

Hi @rubengc,

I have carefully followed your code and the changes made in WordPress 5.8 regarding RadioControl.

First, the versions of Gutenberg in WordPress 5.7 and 5.8 are as follows:

  • WordPress 5.7: Gutenberg 9.9
  • WordPress 5.8: Gutenberg 10.7

And the following PR was merged in 10.0, between Gutenberg 9.9 and Gutenberg 10.7:
Components: Allow extra props for RadioControl component #28631

I further checked the code you reported and confirmed that you have already solved the problem by not passing the value prop to RadioControl.

rubengc/GamiPress-Gutenberg-Blocks@27aaa75#diff-8d293b10b538e055f46f2c756bd7615a35ae7b33882a80fcd0eb96588c08df25R217-R221

Your commit is a change to not pass the value prop in the case of the RadioControl component.
In other words, in WordPress 5.7, RadioControl doesn't accept additional props, so passing a value prop did not cause any problems.
But in WordPress 5.8, additional props are allowed, so RadioControl now receives value props that it is not supposed to.

In this light, it makes sense that your commit fixed the problem.

As stated above, I would like to close this issue as I consider this to be a specification change rather than a bug on the component side.

If you have any questions, please feel free to reopen.

@t-hamano t-hamano closed this as completed Aug 5, 2022
@t-hamano t-hamano removed the Needs Testing Needs further testing to be confirmed. label Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components
Projects
None yet
Development

No branches or pull requests

3 participants