Closed neko-para closed 1 month ago
addEventListener example, which works.
const selEl = useRef<VscodeSingleSelectType | null>(null)
useEffect(() => {
if (selEl.current) {
const ls = (e: Event) => {
console.log(e)
}
selEl.current.addEventListener('change', ls)
return () => {
selEl.current?.removeEventListener('change', ls)
}
}
}, [])
///
<VscodeSingleSelect
ref={selEl}
>
onChange example, which doesn't work.
function onChangeTarget(event: FormEvent<VscodeSingleSelectType>) {
}
///
<VscodeSingleSelect
onChange={onChangeTarget}
>
Currently, neither of
VscodeSingleSelect
norVscodeRadio
callonChange
. Manually addEventListener do help according to comment, but as that issue has been closed and the react wrapper released, doesn't it solved? Or possibly because change event is kind of native events and have some special logic? ButVscodeButton
does trigger click event.