Skip to content

Commit

Permalink
fix: ensure that next action the correct player and action are displayed
Browse files Browse the repository at this point in the history
There seems to be a Combobox bug which causes the value being displayed
to be incorrect. This workaround solves that even though it means you
have to tab twice per Combobox when changing the value since the entire
Combobox is re-rendered I guess.

tailwindlabs/headlessui#3537
  • Loading branch information
omarkohl committed Oct 27, 2024
1 parent a85e5cb commit 94dd2f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ function Actions(
<Combobox<string>
onChange={v => v && setCurrentActorId(v)}
value={currentActorId}
key={currentActorId}
onClose={() => setActorQuery('')}
>
<div className="relative">
Expand Down Expand Up @@ -281,6 +282,7 @@ function Actions(
<Combobox<string>
onChange={(action) => action && setCurrentAction(action)}
value={currentAction}
key={currentAction}
onClose={() => setActionQuery('')}
>
<div className="relative">
Expand Down

0 comments on commit 94dd2f9

Please sign in to comment.