Skip to content

Commit 299739a

Browse files
committed
feat(244): Allow Slideshow controls to autoFocus
1 parent f8d2164 commit 299739a

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

packages/mdx/src/mdx-client/slideshow.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,25 @@ import { extractPreviewSteps } from "./steps"
66

77
export function Slideshow({
88
children,
9-
editorSteps,
9+
className,
10+
code,
1011
codeConfig,
12+
editorSteps,
13+
hasAutoFocusControls,
14+
hasPreviewSteps,
1115
presetConfig,
12-
code,
13-
className,
1416
style,
15-
hasPreviewSteps,
1617
...rest
1718
}: {
1819
children: React.ReactNode
19-
editorSteps: EditorStep[]
20+
className?: string
21+
code?: EditorProps["codeConfig"]
2022
codeConfig: EditorProps["codeConfig"]
23+
editorSteps: EditorStep[]
24+
hasPreviewSteps?: boolean
25+
hasAutoFocusControls?: boolean
2126
presetConfig?: PresetConfig
22-
code?: EditorProps["codeConfig"]
23-
className?: string
2427
style?: React.CSSProperties
25-
hasPreviewSteps?: boolean
2628
}) {
2729
const { stepsChildren, previewChildren } =
2830
extractPreviewSteps(children, hasPreviewSteps)
@@ -98,6 +100,7 @@ export function Slideshow({
98100
Prev
99101
</button>
100102
<input
103+
autoFocus={hasAutoFocusControls}
101104
type="range"
102105
min={0}
103106
max={editorSteps.length - 1}

0 commit comments

Comments
 (0)