Empty state for Autocomplete #7801
Unanswered
fellipeutaka
asked this question in
Q&A
Replies: 1 comment
-
I'm facing the same issue |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm migrating from
cmdk
to the newAutocomplete
component from RAC while trying to keep the same API. One of the challenges I'm facing is implementing the<Command.Empty />
component, which should be rendered when no items are found.However, I'm struggling to access the collection size inside
<Command.Empty />
. I'm attempting to consumeMenuStateContext
, but it returnsnull
.Here’s a simplified version of my implementation:
And here’s how it’s being used:
Summary:
MenuStateContext
is returningnull
inside<Command.Empty />
, even though it's rendered within<Command.List>
, which is effectively a wrapper around theMenu
component from React Aria.<Command.Empty />
have access to theMenuStateContext
?<Command.Empty />
?Any guidance would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions