Fix/687: Jump to block input should not allow negative block numbers or 0 (#918)

* Fix/687: Jump to block input should not allow negative block numbers

* Fix/687: Jump to block input should have a minimum of 1
This commit is contained in:
Sam Keen 2022-07-29 16:20:29 +01:00 committed by GitHub
parent b9d57efacf
commit a4a1c20c7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -29,6 +29,7 @@ export const JumpToBlock = () => {
inputType="number"
inputName="blockNumber"
submitHandler={handleSubmit}
inputMin={1}
/>
);
};

View File

@ -9,6 +9,8 @@ interface JumpToProps {
inputType: HTMLInputTypeAttribute;
inputName: string;
submitHandler: (arg0: SyntheticEvent) => void;
inputMin?: string | number;
inputMax?: string | number;
}
export const JumpTo = ({
@ -18,6 +20,8 @@ export const JumpTo = ({
inputType,
inputName,
submitHandler,
inputMin,
inputMax,
}: JumpToProps) => {
return (
<form onSubmit={submitHandler}>
@ -35,6 +39,8 @@ export const JumpTo = ({
name={inputName}
placeholder={placeholder}
className="max-w-[200px]"
min={inputMin}
max={inputMax}
/>
<Button
data-testid="go-submit"