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

Invalid cursor Postion #103

Open
Gagauz2010 opened this issue Jul 10, 2020 · 0 comments
Open

Invalid cursor Postion #103

Gagauz2010 opened this issue Jul 10, 2020 · 0 comments

Comments

@Gagauz2010
Copy link

I've tried to create date text field with validation of max numbers of dates for leap years and months.

First of all I allow input maximum 31 day (or input 04 if start input with 4). if month is valid, i check maximum day count for current month. Then i check if year is leap and if month is february.

Realization sometimes is dirty, but i understand that correct caret position based on replace function.

Wrong caret position when i start typing 5, or paste 29.02.2017.

Sandbox sample:
https://codesandbox.io/s/hidden-dream-3bicv

Please, can someone explain my mistake (misconception) or this is really unexpected behaviour?

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

1 participant