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:
parent
b9d57efacf
commit
a4a1c20c7c
@ -29,6 +29,7 @@ export const JumpToBlock = () => {
|
||||
inputType="number"
|
||||
inputName="blockNumber"
|
||||
submitHandler={handleSubmit}
|
||||
inputMin={1}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user