Skip to content

Commit 302f09b

Browse files
fix: remove redundant Fragment wrapper around comboButton in dropdowns (#9694)
Combobox.Button as={Fragment} requires its child to be a single real element. Wrapping the button ternary in <>...</> made the child a Fragment instance itself, which @headlessui/react v2 rejects with "Passing props on Fragment!" at runtime. Dropping the wrapper fixes priority, estimate, intake-state, member, module, cycle, state, and project dropdowns.
1 parent 1a76f29 commit 302f09b

8 files changed

Lines changed: 16 additions & 48 deletions

File tree

‎apps/web/core/components/dropdowns/cycle/index.tsx‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ export const CycleDropdown = observer(function CycleDropdown(props: Props) {
8383
handleClose();
8484
};
8585

86-
const comboButton = (
87-
<>
88-
{button ? (
86+
const comboButton = button ? (
8987
<button
9088
ref={setReferenceElement}
9189
type="button"
@@ -130,9 +128,7 @@ export const CycleDropdown = observer(function CycleDropdown(props: Props) {
130128
)}
131129
</DropdownButton>
132130
</button>
133-
)}
134-
</>
135-
);
131+
);
136132

137133
return (
138134
<ComboDropDown

‎apps/web/core/components/dropdowns/estimate.tsx‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ export const EstimateDropdown = observer(function EstimateDropdown(props: Props)
159159
handleClose();
160160
};
161161

162-
const comboButton = (
163-
<>
164-
{button ? (
162+
const comboButton = button ? (
165163
<button
166164
ref={setReferenceElement}
167165
type="button"
@@ -214,9 +212,7 @@ export const EstimateDropdown = observer(function EstimateDropdown(props: Props)
214212
)}
215213
</DropdownButton>
216214
</button>
217-
)}
218-
</>
219-
);
215+
);
220216

221217
return (
222218
<ComboDropDown

‎apps/web/core/components/dropdowns/intake-state/base.tsx‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ export const WorkItemStateDropdownBase = observer(function WorkItemStateDropdown
135135
handleClose();
136136
};
137137

138-
const comboButton = (
139-
<>
140-
{button ? (
138+
const comboButton = button ? (
141139
<button
142140
ref={setReferenceElement}
143141
type="button"
@@ -197,9 +195,7 @@ export const WorkItemStateDropdownBase = observer(function WorkItemStateDropdown
197195
)}
198196
</DropdownButton>
199197
</button>
200-
)}
201-
</>
202-
);
198+
);
203199

204200
return (
205201
// oxlint-disable-next-line jsx_a11y/no-static-element-interactions

‎apps/web/core/components/dropdowns/member/base.tsx‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ export const MemberDropdownBase = observer(function MemberDropdownBase(props: TM
108108
}
109109
};
110110

111-
const comboButton = (
112-
<>
113-
{button ? (
111+
const comboButton = button ? (
114112
<button
115113
ref={setReferenceElement}
116114
type="button"
@@ -159,9 +157,7 @@ export const MemberDropdownBase = observer(function MemberDropdownBase(props: TM
159157
)}
160158
</DropdownButton>
161159
</button>
162-
)}
163-
</>
164-
);
160+
);
165161

166162
return (
167163
<ComboDropDown

‎apps/web/core/components/dropdowns/module/base.tsx‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ export const ModuleDropdownBase = observer(function ModuleDropdownBase(props: TM
111111
}
112112
}, [isOpen, isMobile]);
113113

114-
const comboButton = (
115-
<>
116-
{button ? (
114+
const comboButton = button ? (
117115
<button
118116
ref={setReferenceElement}
119117
type="button"
@@ -171,9 +169,7 @@ export const ModuleDropdownBase = observer(function ModuleDropdownBase(props: TM
171169
/>
172170
</DropdownButton>
173171
</button>
174-
)}
175-
</>
176-
);
172+
);
177173

178174
return (
179175
<ComboDropDown

‎apps/web/core/components/dropdowns/priority.tsx‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,7 @@ export function PriorityDropdown(props: Props) {
398398
? BackgroundButton
399399
: TransparentButton;
400400

401-
const comboButton = (
402-
<>
403-
{button ? (
401+
const comboButton = button ? (
404402
<button
405403
ref={setReferenceElement}
406404
type="button"
@@ -440,9 +438,7 @@ export function PriorityDropdown(props: Props) {
440438
renderToolTipByDefault={renderByDefault}
441439
/>
442440
</button>
443-
)}
444-
</>
445-
);
441+
);
446442

447443
return (
448444
<ComboDropDown

‎apps/web/core/components/dropdowns/project/base.tsx‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ export const ProjectDropdownBase = observer(function ProjectDropdownBase(props:
174174
}
175175
};
176176

177-
const comboButton = (
178-
<>
179-
{button ? (
177+
const comboButton = button ? (
180178
<button
181179
ref={setReferenceElement}
182180
type="button"
@@ -219,9 +217,7 @@ export const ProjectDropdownBase = observer(function ProjectDropdownBase(props:
219217
)}
220218
</DropdownButton>
221219
</button>
222-
)}
223-
</>
224-
);
220+
);
225221

226222
return (
227223
<ComboDropDown

‎apps/web/core/components/dropdowns/state/base.tsx‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ export const WorkItemStateDropdownBase = observer(function WorkItemStateDropdown
136136
handleClose();
137137
};
138138

139-
const comboButton = (
140-
<>
141-
{button ? (
139+
const comboButton = button ? (
142140
<button
143141
ref={setReferenceElement}
144142
type="button"
@@ -199,9 +197,7 @@ export const WorkItemStateDropdownBase = observer(function WorkItemStateDropdown
199197
)}
200198
</DropdownButton>
201199
</button>
202-
)}
203-
</>
204-
);
200+
);
205201

206202
return (
207203
// oxlint-disable-next-line jsx_a11y/no-static-element-interactions

0 commit comments

Comments
 (0)