shadcn-ui/ui

[bug]: block-toolbar component on blocks page stops working if you click the currently active toggle again

ItsValerius opened this issue · 0 comments

Describe the bug

The ToggleGroup component on the blocks page stops working if you click the currently active toggle again.
This is because we pass an empty string to the parseInt function, when the value doesn't change.
Fixing only requires checking if there is a value.
See here in the radix documentation:
https://www.radix-ui.com/primitives/docs/components/toggle-group#ensuring-there-is-always-a-value

Affected component/components

How to reproduce

  1. Go to Blocks page
  2. chose a size
  3. click that size again

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Windows, Firefox/Chrome

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues