diff --git a/src/components/ModalsContainer/CreateBountyModal/CreateBounty/index.tsx b/src/components/ModalsContainer/CreateBountyModal/CreateBounty/index.tsx index 787a6a036..6d2fab435 100644 --- a/src/components/ModalsContainer/CreateBountyModal/CreateBounty/index.tsx +++ b/src/components/ModalsContainer/CreateBountyModal/CreateBounty/index.tsx @@ -30,6 +30,12 @@ export const CreateBounty: FC = ({ errMessage, handleClose }) => { const isDisable = isBudgetValid(watchBudget) && !!watchNodeType + const handleKeyDown = (event: React.KeyboardEvent) => { + if (event.key === ' ') { + event.preventDefault() + } + } + return ( @@ -46,6 +52,7 @@ export const CreateBounty: FC = ({ errMessage, handleClose }) => { { const trimmedBudget = budget.trim() - return !!(trimmedBudget && /^[0-9]+$/.test(trimmedBudget)) + return !!(trimmedBudget && BUDGET_PATTERN.test(trimmedBudget)) } - -export const BUDGET_PATTERN = /^[0-9]+$/