menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

downshift

🏎 Primitives to build simple, flexible, WAI-ARIA compliant enhanced input React components

Channels
Team
Posts
Members
Info

Error: Forgot to call the getDropdownProps getter function on your component /…

Getting this error using the useMultipleSelection hook. My implementation is similar to the Example for useMultipleSelection: Using a styled component - AutocompleteInput …

message-simple
12

How to clear items within useComboBox

I'm loading my 'items' in asynchronously and have put them into state. When I clear out my state to reset the items from within onInputValueChanged, the items within useComboBox don't reset and I get stale results. I noticed that there's no clearItems method available within…

message-simple
1

Pragmatically setting the selected item

I'm using useComboBox for a handful of components with type-ahead behaviour. In some cases, the selection of one also changes the value in another and to make this work I'm passing a selectedItem prop to the components as my state values change. This calls an infinite loop! I'm…

message-simple
3

Asynchronous menu items

Hi all. I'm wondering what the story is around asynchronous menu items? I've got a basic example going using a custom hook, but accessibility-wise it doesn't seem to work correctly due to some internals

message-simple
0

useComboBox - clearSelection

Hey, with useComboBox do we no longer have a clearSelection prop ?

message-simple
1

Using downshift for a dropdown menu with links

Instead of always relying on JavaScript to handle item selection, has anybody figured out a way to render menu items as anchor tags that get "clicked" when they're selected? Imagine a menu with two items: • Show alert: shows some alert message when clicked/keyed …

message-simple
0

Pass a ref to the main menu list

I need to set up an scroll listener on the ul that receives the props from getMenuProps. How can I pass a ref through to this object?

message-simple
1

Get event from onSelect

I need to check to see if a meta key was pressed along with enter to prevent onSelect from firing but the only args present are the item that was selected and the stateAndHelpers object. Any ideas?

message-simple
10

Question

I have currently have a custom dropdown component that only allows one item option to be selected but the requirements have changed to allow multiple selections and single selection. Is there a prop to pass Downshift to define if the custom dropdown will allow multiple…

message-simple
0

Having issues using Downshift with Emotion css-in-js library

When I add the css prop on my root Downshift div, I get the error: downshift: If you return a non-DOM element, you must use apply the getRootProps function

message-simple
1