Skip to content

Commit

Permalink
v0.45.2 - Fix PinInputField prop (#99)
Browse files Browse the repository at this point in the history
* fix prop name pinInput

* Update CHANGELOG.md

Co-authored-by: pankajdwivedi <pankaj@setu.co>
  • Loading branch information
pankaj0308 and pankajdwivedi authored Jan 17, 2023
1 parent 3813efa commit 0af9267
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

### 0.45.2
- Fix prop name for disable copy/paste to pasteFromClipboard which takes either enabled or disabled as parameters for `PinInput Field`

### 0.45.1
- Export props types for all components
- Fix excess margin issue for `Tabs` labels
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fictoan-react",
"version": "0.45.1",
"version": "0.45.2",
"private": false,
"main": "dist/cjs/index.js",
"module": "dist/es/index.js",
Expand Down
22 changes: 11 additions & 11 deletions src/components/PinInputField/PinInputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import { PinInputStyled } from "./PinInputField.styled";

// prettier-ignore
type PinInputFieldCustomProps = {
numberOfFields : number;
onChange ? : (value : string) => void;
type ? : "alphanumeric" | "number";
mask ? : boolean;
otp ? : boolean;
autoFocus ? : boolean;
disableCopyPaste ? : boolean;
spacing ? : SpacingTypes;
numberOfFields : number;
onChange ? : (value : string) => void;
type ? : "alphanumeric" | "number";
mask ? : boolean;
otp ? : boolean;
autoFocus ? : boolean;
pasteFromClipboard ? : "enabled" | "disabled";
spacing ? : SpacingTypes;
};

export type PinInputFieldElementType = HTMLDivElement;
Expand All @@ -38,7 +38,7 @@ export const PinInputField = React.forwardRef(
mask = false,
otp = false,
autoFocus = false,
disableCopyPaste = false,
pasteFromClipboard = "enabled",
spacing = "small",
}: PinInputFieldProps,
ref: React.Ref<PinInputFieldElementType>
Expand Down Expand Up @@ -199,8 +199,8 @@ export const PinInputField = React.forwardRef(
autoComplete={otp ? "one-time-code" : "off"}
value={values[i] || ""}
autoFocus={autoFocus && i === 0}
onCopy={e=> disableCopyPaste && e.preventDefault()}
onPaste={e=> disableCopyPaste && e.preventDefault()}
onCopy={e=> pasteFromClipboard === "disabled" && e.preventDefault()}
onPaste={e=> pasteFromClipboard === "disabled" && e.preventDefault()}
/>
))}
</Element>
Expand Down

0 comments on commit 0af9267

Please # to comment.