Callbacks in command (Loading Sub Commands ) #726
-
Is your feature request related to a problem? Please describe. Describe the solution you'd like
Feature 2) Be able to return a call back / promise in the function to close the loading indicator and also maybe even the modal, as i have some almost instant commands that still leaves the spinner spinning for a few seconds after it! Describe alternatives you've considered Maybe they could be a submenu built in but also a promise to fetch more submenus from an api? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@burnsy it sounds like you want "sub-commands". There's an example in this codesandbox The React Command Palette renders whatever list of commands it's passed at the time they are passed in. Using the When the user selects a child command the spinner can be displayed using the Please let me know if you have any additional questions. |
Beta Was this translation helpful? Give feedback.
@burnsy it sounds like you want "sub-commands". There's an example in this codesandbox
https://codesandbox.io/s/react-command-palette-subcommands-gw1zy
The React Command Palette renders whatever list of commands it's passed at the time they are passed in. Using the
closeOnSelect
prop, the UI can be forced to remain open while the new commands are loaded. Provided the search is quick, under say 1-4 sec the user experience will be good.When the user selects a child command the spinner can be displayed using the
showSpinnerOnSelect
prop.Please let me know if you have any additional questions.