Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can no longer access keepCharPositions parameter in version 3.1.0 #1144

Closed
nikolayg opened this issue Jun 25, 2019 · 4 comments · Fixed by #1661
Closed

Can no longer access keepCharPositions parameter in version 3.1.0 #1144

nikolayg opened this issue Jun 25, 2019 · 4 comments · Fixed by #1661

Comments

@nikolayg
Copy link

Hi there,

Thanks for your work on this great library!

I've been trying to set the keepCharPositions flag for the underlying text field. I followed the solution in this issues, but it doesn't seem to be working for @material-ui/pickers version 3.1.0.

For example, in the following code keepCharPositions does not take effect:

    <KeyboardDatePicker
      autoOk={true}
      variant="inline"
      label={"Test"}
      format={"dd/MM/yyyy"}
      inputValue={"12/12/1900"}
      value={null}
      InputAdornmentProps={{ position: "end" }}
      placeholder={"__/__/____"}
      onChange={(_date, value) => {
        console.log(value);
      }}
      InputProps={{
        inputProps: {
          keepCharPositions: true
        }
      }}
    />

Any ideas how to use keepCharPositions with the latest version?

@dmtrKovalenko
Copy link
Member

dmtrKovalenko commented Jun 29, 2019

Hey @TrySound do you know is it possible to make smth simmilar to keepCharPositions from react-text-mask with rifm?

@dmtrKovalenko dmtrKovalenko added the status: incomplete Need more information label Jun 29, 2019
@TrySound
Copy link
Contributor

We have mask flag in the new version for this. In the version you use it's replace: string => boolean.

@dmtrKovalenko
Copy link
Member

dmtrKovalenko commented Jun 30, 2019

Hmm, but can we update to the latest rifm without major release? We are exposing only refuse api prop

@TrySound
Copy link
Contributor

Refuse is replaced with inverted accept. I'm not sure it is possible to convert this regexp. Upgrade will be a breaking change. You may add keepCharPositions option for now which will wrap replace and after upgrade mask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants