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

Datetime jumping caret lag #87

Open
Defite opened this issue Jun 22, 2024 · 5 comments
Open

Datetime jumping caret lag #87

Defite opened this issue Jun 22, 2024 · 5 comments

Comments

@Defite
Copy link

Defite commented Jun 22, 2024

Link to reproduce issue: codesandbox

Steps to reproduce:

  1. Type correct date
  2. Clear field - "Field is required" is showing
  3. Try to type new date

Showcase:
Screen Recording 2024-06-22 at 20 12 31

@levipadre
Copy link

Hi @Defite. I have the same issue. Have you found any solution to this by any chance?

@Defite
Copy link
Author

Defite commented Aug 20, 2024

Hi @Defite. I have the same issue. Have you found any solution to this by any chance?

Hi. No, I moved on with another library(

@Defite
Copy link
Author

Defite commented Aug 21, 2024

@Defite which library? I'm having the same issue.

I use react-imask.

@thgcst
Copy link

thgcst commented Aug 22, 2024

@Defite In my case, I was trying to use the currency mask, and had the same caret jumping issue.

I dug into the code and found the problem.

Looks like every time you pass an empty array as the placeholder on inputmask it behaves weirdly. Their doc suggests to use " ". In my case by just passing placeholder: "0" the issue was fixed.

@eduardoborges great lib btw. Brasil representando 🚀

@Defite
Copy link
Author

Defite commented Aug 23, 2024

@thgcst in my case it didn't helped :( I use it like this:

<input
  {...registerWithMask("date", "datetime", {
    inputFormat: "yyyy-mm-dd",
    placeholder: "0",
    required: "Field is required",
  })}
  type="text"
/>

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

No branches or pull requests

3 participants