Skip to content

Commit

Permalink
fix: selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Vtec234 committed May 31, 2023
1 parent 51bff92 commit 3b157dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion widget/src/exprPresentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default function ({ pos, expr }: { pos: DocumentPosition, expr: ExprWithC
if (st.state === 'rejected')
return <>Error: {mapRpcError(st.error).message}</>
else if (st.state === 'resolved') {
console.log(selection, st.value)
let selectionName: Name | 'none' = 'none'
if (selection.tag === 'auto' && 0 < st.value.size)
selectionName = Array.from(st.value.values())[0].name
Expand All @@ -61,7 +62,7 @@ export default function ({ pos, expr }: { pos: DocumentPosition, expr: ExprWithC
className='fr'
value={selectionName}
onChange={ev => {
setSelection({ tag: 'manual', name: ev.target.name })
setSelection({ tag: 'manual', name: ev.target.value })
}}
>
{Array.from(st.value.values(), pid =>
Expand Down

0 comments on commit 3b157dc

Please sign in to comment.