You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I wanted to implement Autocomplete with a popover on Menu so when I start typing in the Input field, the Popover would trigger open and when I select on a MenuItem the Input text would get overridden and the Popover will close. Is it possible to compose this? I tried adding MenuTrigger but nothing would render and it seems incompatible. Thanks
import {Autocomplete, Button, Input, Label, Menu, MenuItem, SearchField, useFilter} from 'react-aria-components';
function Example() {
let { contains } = useFilter({ sensitivity: 'base' });
return (
<div className="autocomplete">
<Autocomplete filter={contains}>
<SearchField>
<Label>Commands</Label>
<Input placeholder="Search commands...." /> <---- the trigger should be input to this field
<Button>✕</Button>
</SearchField>
<Menu> <------ Menu should render in a popover while allowing user to type in Input field
<MenuItem>Create new file...</MenuItem>
<MenuItem>Create new folder...</MenuItem>
<MenuItem>Assign to...</MenuItem>
<MenuItem>Assign to me</MenuItem>
<MenuItem>Change status...</MenuItem>
<MenuItem>Change priority...</MenuItem>
<MenuItem>Add label...</MenuItem>
<MenuItem>Remove label...</MenuItem>
</Menu>
</Autocomplete>
</div>
);
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I wanted to implement
Autocomplete
with a popover onMenu
so when I start typing in theInput
field, thePopover
would trigger open and when I select on aMenuItem
theInput
text would get overridden and thePopover
will close. Is it possible to compose this? I tried addingMenuTrigger
but nothing would render and it seems incompatible. ThanksBeta Was this translation helpful? Give feedback.
All reactions