Skip to content

Commit 171eb62

Browse files
authored
fix: issue with invalid options (#4260)
1 parent 5c13704 commit 171eb62

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

packages/components/src/components/select/select.lite.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,16 @@ export default function DBSelect(props: DBSelectProps) {
237237
<For each={props.options}>
238238
{(option: DBSelectOptionType) => (
239239
<>
240-
<Show when={option.options}>
240+
<Show
241+
when={option.options}
242+
else={
243+
<option
244+
value={option.value}
245+
disabled={option.disabled}
246+
selected={option.selected}>
247+
{state.getOptionLabel(option)}
248+
</option>
249+
}>
241250
<optgroup
242251
label={state.getOptionLabel(option)}>
243252
<For each={option.options}>
@@ -261,14 +270,6 @@ export default function DBSelect(props: DBSelectProps) {
261270
</For>
262271
</optgroup>
263272
</Show>
264-
<Show when={!option.options}>
265-
<option
266-
value={option.value}
267-
disabled={option.disabled}
268-
selected={option.selected}>
269-
{state.getOptionLabel(option)}
270-
</option>
271-
</Show>
272273
</>
273274
)}
274275
</For>

0 commit comments

Comments
 (0)