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
{{ message }}
Repository navigation
Auto-selection of first item doesn't work with deferred values / suspense queries #250
We do get the desired behavior if we remove the shouldFilter={false}, but the auto-selection behavior should still work if you're relying on external filtering behavior.
Yep, ultimately the workaround we implemented was something like this, but it feels hacky to have to have a side effect on state to accomplish this. Ideally, the behavior should come baked in with Command if the user is not using it as a controlled component.
Activity
updbqn commentedon May 23, 2024
A workaround is to make the Command component controlled and set the selected item yourself when the items change.
https://codesandbox.io/p/devbox/cmdk-suspense-forked-8qsltv?workspaceId=693b57f1-c881-460c-b8d5-92868a4692cc
arvinpoddar commentedon May 23, 2024
Yep, ultimately the workaround we implemented was something like this, but it feels hacky to have to have a side effect on state to accomplish this. Ideally, the behavior should come baked in with Command if the user is not using it as a controlled component.