Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
make input responsive to enter key press
Browse files Browse the repository at this point in the history
  • Loading branch information
eggplantzzz committed Jun 29, 2023
1 parent 9c917e8 commit 763164d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/dashboard/src/components/composed/Debugger/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 140,7 @@ function Debugger(): JSX.Element {
}
};

const onButtonClick = async () => {
const startDebugger = async () => {
setStatus(SessionStatus.PreparingForInitialization);
const provider = window.ethereum;
if (!provider) {
Expand Down Expand Up @@ -186,6 186,16 @@ function Debugger(): JSX.Element {
}
};

const onButtonClick = () => startDebugger();

// make input responsive to "enter" key
const handleKeyDown = (e: any) => {
if (formDisabled) return;
if (e.keyCode === 13) {
startDebugger();
}
};

const buttonStyles = {
height: "42px",
borderTopLeftRadius: "0px",
Expand Down Expand Up @@ -298,6 308,7 @@ function Debugger(): JSX.Element {
disabled={inputsDisabled}
type="text"
placeholder="Transaction hash"
onKeyDown={handleKeyDown}
/>
<Button
onClick={onButtonClick}
Expand Down

0 comments on commit 763164d

Please sign in to comment.