Closed olafsulich closed 2 years ago
Hi! I wonder how can I control my shortcut actions outside of the actual KBar Item.
Problem: I want to control undo/redo state by shortcuts AND by separate buttons, how can I do it?
Example:
function App () { return <KBarProvider>...</KBarProvider> } function Parent() { const { results } = useMatches(); useRegisterActions([{ // ...properties shortcut: ['Backspace'], perform: () => {} }]) return ( <Child /> <KBarResults results={results} onRender={() => {}} /> ) } function Child() { const handleClick = () => { // here I want to undo the internal KBar history state } return <button onClick={handleClick}>undo</button> }
Hey! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi! I wonder how can I control my shortcut actions outside of the actual KBar Item.
Problem: I want to control undo/redo state by shortcuts AND by separate buttons, how can I do it?
Example: