+ {options.length === 0 ? (
+
No options available
+ ) : (
+ options.map((option, index) => (
+
handleSelect(option)}
+ onMouseEnter={() => !option.disabled && setHighlightedIndex(index)}
+ role="option"
+ aria-selected={option.value === value}
+ aria-disabled={option.disabled}
+ >
+ {option.label}
+
+ ))
+ )}
+
+ )}
+
);
}
diff --git a/tsunami/frontend/src/vdom.tsx b/tsunami/frontend/src/vdom.tsx
index 4d103f29cd..ec606ee691 100644
--- a/tsunami/frontend/src/vdom.tsx
+++ b/tsunami/frontend/src/vdom.tsx
@@ -282,6 +282,17 @@ function WaveMarkdown({ elem, model }: { elem: VDomElem; model: TsunamiModel })
function WaveDropdown({ elem, model }: { elem: VDomElem; model: TsunamiModel }) {
const props = useVDom(model, elem);
+
+ // Create a handler that wraps the onChange prop if it exists
+ const handleChange = props?.onChange ? (value: string) => {
+ // Create a synthetic event-like object for VDOM
+ const syntheticEvent = {
+ target: { value },
+ currentTarget: { value }
+ } as any;
+ props.onChange(syntheticEvent);
+ } : undefined;
+
return (