We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc97673 commit db106ecCopy full SHA for db106ec
src/drafts/SelectPanel2/stories/SelectPanel.examples.stories.tsx
@@ -718,6 +718,12 @@ export const CreateNewRow = () => {
718
onLabelSelect(id) // select newly created label
719
720
setPanelOpen(true)
721
+
722
+ // focus newly created label once it renders
723
+ window.requestAnimationFrame(() => {
724
+ const newLabelElement = document.querySelector(`[data-id=${id}]`) as HTMLLIElement
725
+ newLabelElement.focus()
726
+ })
727
}
728
729
return (
@@ -754,6 +760,7 @@ export const CreateNewRow = () => {
754
760
key={label.id}
755
761
onSelect={() => onLabelSelect(label.id)}
756
762
selected={selectedLabelIds.includes(label.id)}
763
+ data-id={label.id}
757
764
>
758
765
<ActionList.LeadingVisual>
759
766
<Box
0 commit comments