diff --git a/lib/ui/src/core/shortcuts.js b/lib/ui/src/core/shortcuts.js index 0e5ae59ab108..9c07925da757 100644 --- a/lib/ui/src/core/shortcuts.js +++ b/lib/ui/src/core/shortcuts.js @@ -101,11 +101,14 @@ export default function initShortcuts({ store }) { if (!showNav) { fullApi.toggleNav(); } - const element = document.getElementById('storybook-explorer-searchfield'); - if (element) { - element.focus(); - } + setTimeout(() => { + const element = document.getElementById('storybook-explorer-searchfield'); + + if (element) { + element.focus(); + } + }, 0); break; }