Jump on next segment when pressing separator key#26
Conversation
|
@eight04 Dont know how to write tests for this :-( I have problem with triggering user input. Keyboard events are not exactly what I need to simulate an user input. Also I am not sure how to add leading zeros. I would have to change date before validation somehow. Do you have any idea? Is it ok to merge this PR in this state? |
|
I think it's pretty hard to test. You can try:
This seems confusing for me. Is there any other datetime widget following this behavior?
👍 |
|
Wait, I got it. I think we have to cache Then Adding a |
ef76982 to
7913cf0
Compare
|
Got it working but I am not entirely sure if its done the right way regarding style :-) Basically when Still having problem with writing test :( focusing input doesn't make a selection. If you want to try out I made a separate branch for it: https://github.com/MartinNuc/angular-datetime/tree/jump-on-separator-press-test |
|
I will try to implement your way. I wanted to avoid global variable so i put error basically in the node itself. Let me try it :-) and thanks for help. |
|
Indeed much cleaner solution :-) Tried tests in Chrome but its the same :-( If you are fine that its not tested feel free to merge this PR. |
|
👍 |
Related issue: #25
This PR adds option to jump on the next segment when pressing separator key. For example when filling month in format:
5.7.2016you can press keys:5.7.and2016Still in progress. To-Do:
HH:mm:ss- when pressing4and:on minute segment it should fill04and jump on seconds