Skip to content

ToggleGroupControlOption with an empty string ("") value does not display as selected #69925

@spstrap

Description

@spstrap

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

  1. Use ToggleGroupControl and pass a value of "".
  2. Inside, include a ToggleGroupControlOption where value="".
  3. 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

Metadata

Metadata

Assignees

Labels

[Package] Components/packages/components[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions