mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
adding an API function to focus on a document element
This commit is contained in:
parent
26a822aeea
commit
d7df1c18c1
@ -4,6 +4,7 @@ import deprecate from 'util-deprecate';
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
|
||||
import { themes } from '@storybook/theming';
|
||||
import { document } from 'global';
|
||||
import merge from '../libs/merge';
|
||||
|
||||
const deprecatedThemeOptions = {
|
||||
@ -149,6 +150,13 @@ export default function({ store }) {
|
||||
});
|
||||
},
|
||||
|
||||
focusOnUIElement(elementId) {
|
||||
const element = document.getElementById(elementId);
|
||||
if (element) {
|
||||
element.focus();
|
||||
}
|
||||
},
|
||||
|
||||
setOptions: options => {
|
||||
// The very first time the user sets their options, we don't consider what is in the store.
|
||||
// At this point in time, what is in the store is what we *persisted*. We did that in order
|
||||
|
Loading…
x
Reference in New Issue
Block a user