-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Fixing search item in menu #6027
Changes from 3 commits
d7df1c1
4f85dfe
c4079e2
bdfb720
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,11 +86,7 @@ export default function initShortcuts({ store }) { | |
if (!showNav) { | ||
fullApi.toggleNav(); | ||
} | ||
const element = document.getElementById('storybook-explorer-menu'); | ||
|
||
if (element) { | ||
element.focus(); | ||
} | ||
fullApi.focusOnUIElement('storyListMenu'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you pull these constants out to be shared between modules? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure thing, on it. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we'll change it to an enum later 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm then do you want me to just export them for now? |
||
break; | ||
} | ||
|
||
|
@@ -103,11 +99,7 @@ export default function initShortcuts({ store }) { | |
} | ||
|
||
setTimeout(() => { | ||
const element = document.getElementById('storybook-explorer-searchfield'); | ||
|
||
if (element) { | ||
element.focus(); | ||
} | ||
fullApi.focusOnUIElement('storySearchField'); | ||
}, 0); | ||
break; | ||
} | ||
|
@@ -133,11 +125,7 @@ export default function initShortcuts({ store }) { | |
if (!showPanel) { | ||
fullApi.togglePanel(); | ||
} | ||
const element = document.getElementById('storybook-panel-root'); | ||
|
||
if (element) { | ||
element.focus(); | ||
} | ||
fullApi.focusOnUIElement('storyPanelRoot'); | ||
break; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: even if
undefined == null
can we change this check to be!focusableElements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it's what it was before, I was unsure of JS' best practices for that. Thanks!