-
Notifications
You must be signed in to change notification settings - Fork 4.7k
ToggleGroupControlOption with an empty string ("") value does not display as selected #69925
Copy link
Copy link
Closed
Labels
[Package] Components/packages/components/packages/components[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
When using ToggleGroupControlOption with a value of "" (empty string), the option does not appear selected, even when the value prop of the parent ToggleGroupControl is correctly set to "".
This makes it impossible to visually reflect the selection of an empty string value, even though the internal state is technically correct.
When value="" is passed to both ToggleGroupControl and ToggleGroupControlOption, the option should be visibly selected like any other value.
Step-by-step reproduction instructions
- Use ToggleGroupControl and pass a value of "".
- Inside, include a ToggleGroupControlOption where value="".
- Observe that the option does not appear selected, even though the value matches.
Screenshots, screen recording, code snippet
No response
Environment info
wordpress 6.8
chrome
win 10
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Package] Components/packages/components/packages/components[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.