Skip to content

Commit

Permalink
implement handleOnPaste
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharqiewicz committed Sep 30, 2024
1 parent c7df278 commit 9a8d44f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/Form/From/NumericInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export const NumericInput = ({
register.onChange(e);
}

function handleOnPaste(e: ClipboardEvent): void {
handleOnPasteNumericInput(e, maxDecimals);
register.onChange(e);
}

return (
<div className="flex w-full justify-between">
<div className="font-outfit flex-grow text-4xl text-black">
Expand All @@ -41,7 +46,7 @@ export const NumericInput = ({
minlength="1"
onChange={handleOnChange}
onKeyDown={handleOnKeyDownNumericInput}
onPaste={(e: ClipboardEvent) => handleOnPasteNumericInput(e, maxDecimals)}
onPaste={handleOnPaste}
pattern="^[0-9]*[.,]?[0-9]*$"
placeholder="0.0"
readOnly={readOnly}
Expand Down

0 comments on commit 9a8d44f

Please sign in to comment.