Skip to content

Commit 9c63b79

Browse files
committed
add new props for auto focus on editor component
1 parent 7688fdc commit 9c63b79

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/features/debugger/components/debugger-toolbar/debugger-toolbar.component.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ export const DebuggerToolbarComponent: React.FC<
2323
const setActiveWidget$ = useDebuggerStore((state) => state.setActiveWidget$);
2424
const isDecoder = activeWidget$ === DebuggerWidgetValues.DECODER;
2525

26-
useEffect(() => {
27-
tabRefs.current[isDecoder ? 0 : 1]?.focus();
28-
}, [isDecoder]);
29-
3026
const handleKeyDown = (e: React.KeyboardEvent<HTMLLIElement>) => {
3127
const { key } = e;
3228

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

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

44
interface JwtEditorComponentProps {
@@ -14,6 +14,8 @@ export const JwtEditorComponent: React.FC<JwtEditorComponentProps> = ({
1414
<EditorComponent
1515
aria-label="JWT editor input"
1616
value={token}
17+
autoFocus
18+
focusOnWindowFocus
1719
onValueChange={(code) => handleJwtChange(code)}
1820
highlight={(code) => {
1921
if (!code) {

0 commit comments

Comments
 (0)