Skip to content

Commit 348a48e

Browse files
authored
fix: Set css states on the right element (#5436)
## Description Radio group route doesn't have checked/unchecked states via data-state attribute, only the button and indicator do. ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent 0b8c23e commit 348a48e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/sdk-components-react-radix/src/radio-group.ws.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ export const metaRadioGroup: WsComponentMeta = {
1616
children: ["instance"],
1717
descendants: [radix.RadioGroupItem],
1818
},
19-
states: [
20-
{ label: "Checked", selector: "[data-state=checked]" },
21-
{ label: "Unchecked", selector: "[data-state=unchecked]" },
22-
],
2319
presetStyle: {
2420
div,
2521
},
@@ -34,6 +30,10 @@ export const metaRadioGroupItem: WsComponentMeta = {
3430
children: ["instance"],
3531
descendants: [radix.RadioGroupIndicator],
3632
},
33+
states: [
34+
{ label: "Checked", selector: "[data-state=checked]" },
35+
{ label: "Unchecked", selector: "[data-state=unchecked]" },
36+
],
3737
presetStyle: {
3838
button: [button, buttonReset].flat(),
3939
},
@@ -47,6 +47,10 @@ export const metaRadioGroupIndicator: WsComponentMeta = {
4747
category: "none",
4848
children: ["instance"],
4949
},
50+
states: [
51+
{ label: "Checked", selector: "[data-state=checked]" },
52+
{ label: "Unchecked", selector: "[data-state=unchecked]" },
53+
],
5054
presetStyle: {
5155
span,
5256
},

0 commit comments

Comments
 (0)