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

Bug: Date Widgets does not allow typing in a date. #1178

Closed
DomtronVox opened this issue Mar 17, 2018 · 7 comments
Closed

Bug: Date Widgets does not allow typing in a date. #1178

DomtronVox opened this issue Mar 17, 2018 · 7 comments

Comments

@DomtronVox
Copy link

- Do you want to request a feature or report a bug?
Bug

- What is the current behavior?
Date and DateTime widgets updates (?) after every character you type, often overwriting what your trying to enter.

- If the current behavior is a bug, please provide the steps to reproduce.
For example, let's say I have 01/06/2018 in the widget. I want to change it to 2008. However, Placing the cursor at the end and hitting backspace immediately updates the widget so it says 01/06/0201. Also hitting backspace again updates it to 01/06/2020 which adds confusion (where did the 2 at the start come from? shouldn't it say 0020 to be consistent?).

Second example, let's say I want to type in 01/05/2004. I delete the contents of the widget and type 0. It immediately fills in with 01/01/2000 completely unbidden and prevents any more typing at the end. I have to move the cursor to each character and try to delete then type in my number.

- What is the expected behavior?
While trying to type in a date, the widget should only update the content and reformat once you click out of the field or hit enter/tab.

- Please mention your CMS, node.js, and operating system version.

- Please link or paste your config.yml below if applicable.
Just a standard date field definition.

      - {required: false,  label: "Birth Date", name: "birth_date", widget: "date"}

- Notes.

This is a fairly frustrating bug. It does have some rhyme and reason, but on the surface looks like it just changes your input randomly. Currently you can set the date by copy and pasting in a valid date format (like 01/05/2004) or using the graphical picker. Both these work fine in my experience. But many will want to just type in dates directly from memory which invokes this bug and makes them frustrated.

Apologies if this is a known issue. I searched and didn't find anything.

Thank you.

@tech4him1
Copy link
Contributor

I'd consider this a bug as well, that should be fixed as long as it doesn't break the "date picker" part. @erquhart Is there any reason that we can't use the internal formatting portions in react-datetime instead of formatting the value afterwards? That would most likely fix this.

@erquhart
Copy link
Contributor

Not certain if we did it that way for a reason or not, but any fix that doesn't bring regressions would be welcome in my opinion.

@gazebosx3
Copy link
Contributor

This one seems interesting! I'd love to take a look at it.

@tech4him1
Copy link
Contributor

@gazebosx3 Have at it! Let me know if you have any questions!

@Dammmien
Copy link
Contributor

@gazebosx3 are you looking at the topic or I can take a look ?

@gazebosx3
Copy link
Contributor

Hey, sorry---I've been slammed over the past couple of weeks, so yeah, go ahead and take it. Sorry :(

@DomtronVox
Copy link
Author

Thank you!

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

No branches or pull requests

5 participants