Skip to content

Commit ce857b1

Browse files
committed
add autofocus prop to jwt editor component
1 parent dff7409 commit ce857b1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/features/decoder/components/jwt-editor.component.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
import React, { useEffect } from "react";
1+
import React from "react";
22
import { EditorComponent } from "@/features/common/components/code-editor/editor.component";
33

44
interface JwtEditorComponentProps {
55
token: string;
66
handleJwtChange: (value: string) => void;
7+
autoFocus: boolean
78
}
89

910
export const JwtEditorComponent: React.FC<JwtEditorComponentProps> = ({
1011
token,
12+
autoFocus,
1113
handleJwtChange,
1214
}) => {
1315
return (
1416
<EditorComponent
1517
aria-label="JWT editor input"
1618
value={token}
17-
autoFocus
18-
focusOnWindowFocus
19+
autoFocus={autoFocus}
20+
focusOnWindowFocus={autoFocus}
1921
onValueChange={(code) => handleJwtChange(code)}
2022
highlight={(code) => {
2123
if (!code) {

0 commit comments

Comments
 (0)