mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
fixing search item in menu and minor refactor
This commit is contained in:
parent
d7df1c18c1
commit
4f85dfe701
@ -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 />,
|
||||
},
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user