Skip to content

handle paste in ReactCodeInput component  #1

Open
@mahdij98

Description

@mahdij98

when im trying to paste a number it will paste it in the first box only :

import ReactCodeInput from "react-code-input";
<ReactCodeInput
                  inputStyle={{
                    fontFamily: "iranYekan",
                    margin: "6px",
                    MozAppearance: "textfield",
                    textAlign: "center",
                    borderRadius: "6px",
                    fontSize: "20px",
                    backgroundColor: "#E2E4F3",
                    color: "#000",
                    border: "none",
                    padding: "4px",
                    outlineColor: "#7067ff",
                  }}
                  inputStyleInvalid={{
                    fontFamily: "iranYekan",
                    margin: "4px",
                    MozAppearance: "textfield",
                    width: "15px",
                    borderRadius: "6px",
                    fontSize: "14px",
                    height: "26px",
                    padding: "4px",
                    backgroundColor: "black",
                    color: "red",
                    border: "1px solid red",
                  }}
                  name={""}
                  inputMode={"tel"}
                  type="number"
                  fields={5}
                  // {...codeInputProps}
                  onChange={(value: any) => {
                    setCodeValue(value);
                    setEmailErros("");
                  }}
                  value={codeValue}
                />
            my version is 8.19.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions