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

Carret moved to end of input when date is invalid #297

Closed
5 tasks done
fbeauche opened this issue Nov 16, 2017 · 5 comments
Closed
5 tasks done

Carret moved to end of input when date is invalid #297

fbeauche opened this issue Nov 16, 2017 · 5 comments
Labels

Comments

@fbeauche
Copy link

With the day picker directive ( and day time picker directive ), the carret is moved to the end of the input when the date is invalid.

This does not happens with the components.

See this screencast :
daypickerbug

  • Provide a minimal code snippet, please make sure it is well formatted.
    tested on the demo page
  • Provide a stackblitz demo / stackblitz example that reproduces the bug.
    tested on the demo page
  • Provide screenshots where appropriate
    See attached gif
  • What's the version of Angular you're using?
    tested on the demo page
  • Does this occur on specific browser?
    Tested on chrome, edge and IE
@vlio20 vlio20 added the bug label Nov 17, 2017
@pklein
Copy link
Contributor

pklein commented Nov 22, 2017

After experiencing this issue as well, I had a quick look at the code and suspect this issue is occurring due to date-picker.directive.ts:184 and date-picker.directive.ts:200.

It appears that the form control is being updated all the time, which pushes the cursor to the end?

I get why this is happening when the user selects a date from the picker, but when they're typing via the input box, we probably don't need to update the input box again (it should already have the value).

@vlio20
Copy link
Owner

vlio20 commented Nov 22, 2017

@pklein, good point. Do you want to submit a PR?

@vlio20
Copy link
Owner

vlio20 commented Nov 29, 2017

resolved in c96f2a2

@vlio20 vlio20 closed this as completed Nov 29, 2017
@WaterBleu
Copy link

@vlio20 is this the same reason why attempting to type in the date would flicker?

@vlio20
Copy link
Owner

vlio20 commented Nov 29, 2017

Might be.

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

No branches or pull requests

4 participants