Created
November 8, 2022 15:36
-
-
Save ddanielsantos/9af0dd3386cb3b43675830d2f0435e3e to your computer and use it in GitHub Desktop.
reproduction that triggers Maximum update depth exceeded on ariakit version: 2.0.0-next.41, when using a Combobox inside other two Ariakit components
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
useSelectState, | |
Select, | |
SelectPopover, | |
SelectItem, | |
} from 'ariakit/select' | |
import { | |
Dialog, | |
DialogHeading, | |
DialogDismiss, | |
useDialogState, | |
} from 'ariakit/dialog' | |
import { | |
Combobox, | |
useComboboxState, | |
ComboboxPopover, | |
ComboboxItem, | |
} from 'ariakit/combobox' | |
const onSubmit = () => {} | |
export function ShippingAddressSelection() { | |
const select_id = useSelectState() | |
const dialog = useDialogState() | |
const combobox = useComboboxState() | |
return ( | |
<> | |
<Select state={select_id} /> | |
<SelectPopover state={select_id}> | |
<SelectItem onClick={dialog.toggle}>toggle dialog</SelectItem> | |
<Dialog state={dialog}> | |
<form onSubmit={onSubmit}> | |
<DialogHeading>do action</DialogHeading> | |
<label> | |
input label: | |
<input name={'input_name'} /> | |
</label> | |
<div> | |
<label> | |
Your favorite fruit | |
<Combobox state={combobox} placeholder='e.g., Apple' /> | |
</label> | |
<ComboboxPopover state={combobox}> | |
<ComboboxItem value='1'>1</ComboboxItem> | |
</ComboboxPopover> | |
</div> | |
<div> | |
<DialogDismiss>cancel</DialogDismiss> | |
<button type='submit'>save</button> | |
</div> | |
</form> | |
</Dialog> | |
<SelectItem value='address 1' /> | |
<SelectItem value='address 2' /> | |
</SelectPopover> | |
</> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment