Skip to content

Commit c81ae40

Browse files
committed
fix(editor): improve item selection handling in select list
* and remove the unused import
1 parent f9a640e commit c81ae40

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/frontend/widgets/Picker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { ButtonHTMLAttributes, FC, ReactNode, useEffect, useId, useRef, JSX } from 'react';
22
import { Options } from './Select';
3-
import type { CoralIcon } from '../coral/custom-elements';
43

54
export const Picker: FC<{
65
items: Options;
@@ -22,7 +21,8 @@ export const Picker: FC<{
2221
}
2322

2423
function selectlistChanged(e: Event) {
25-
const item = e.target as HTMLOptionElement;
24+
const item = (e.target as HTMLElement).closest<HTMLElement & { value: string; selected: boolean }>('coral-selectlist-item');
25+
if (!item) return;
2626
popover!.open = false;
2727
picked(item.value);
2828
item.selected = false;

0 commit comments

Comments
 (0)