fixing search item in menu and minor refactor

This commit is contained in:
Phoenixton 2019-03-11 22:55:22 +01:00
parent d7df1c18c1
commit 4f85dfe701
2 changed files with 2 additions and 6 deletions

View File

@ -41,7 +41,7 @@ const createMenu = memoize(1)((api, shortcutKeys, isFullscreen, showPanel, showN
{
id: '/',
title: 'Search',
onClick: () => {},
onClick: () => api.focusOnUIElement('storybook-explorer-searchfield'),
right: shortcutToHumanString(shortcutKeys.search),
left: <ListItemIcon />,
},

View File

@ -103,11 +103,7 @@ export default function initShortcuts({ store }) {
}
setTimeout(() => {
const element = document.getElementById('storybook-explorer-searchfield');
if (element) {
element.focus();
}
fullApi.focusOnUIElement('storybook-explorer-searchfield');
}, 0);
break;
}