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

Proposal: Ability to type a date into CalendarDatePicker #735

Open
tbolon opened this issue May 21, 2019 · 9 comments
Open

Proposal: Ability to type a date into CalendarDatePicker #735

tbolon opened this issue May 21, 2019 · 9 comments
Labels
area-DateTimePickers DatePicker, TimePicker, CalendarDatePicker, CalendarView area-TextBox TextBox, RichEditBox feature proposal New feature proposal needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) team-Controls Issue for the Controls team

Comments

@tbolon
Copy link

tbolon commented May 21, 2019

Proposal: Better keyboard input on CalendarDatePicker

Summary

Allow the CalendarDatePicker to be better used with the keyboard, allowing direct date input with numeric values (numbers and date separator) instead of relying on the calendar navigation (space/enter/arrow keys) which is really slow.

Rationale

  • better feature alignment with existing native controls (winforms and wpf): both of them allow to type the date value when the control is focused (eg. 5/5/19)
  • address more LOB scenarios where date fields are used a lot, remove pain points when converting from other ui frameworks
  • focus more on efficiency (number of key press required)

Scope

Capability Priority
Allow end users to quickly type a date only using numbers and date separator Must
Use system short date format to parse input Must
Allow relaxed inputs (suppose current year if missing) Must
Ignore any invalid input and revert to last valid value Should
This input method is optional and could be disabled to keep current behavior Should
Allow number block navigation using keys (pressing right key while focused on month part should move to the year part) Could
Allow date computation using quick formulas (+2d to add two days to current date) Could
Handle complex input with custom date format Won't

Important Notes

We are considering migrating our lob app on WinUI, but are not really impressed by the native controls exposed.

Open Questions

I know that this framework is still quite new, and is still a lot oriented on smartphones/tablets and mouse/touch input, but if you want to allow developers to create more LOB apps, I think you should add more keyboard and efficiency focused features.

I also created this suggestion because a demo was presented at the build for an input control with a calculator feature (#483). This feature seems to be oriented on business users, like this one.

Related: this feature could also target the DatePicker control to better allow keyboard based input (still based on date value instead of control navigation) and/or allow typing a value using arrow keys without needing the popup control.

@tbolon tbolon added the feature proposal New feature proposal label May 21, 2019
@msft-github-bot msft-github-bot added this to Freezer in Feature tracking May 21, 2019
@msft-github-bot msft-github-bot added this to Needs triage in Controls Triage May 21, 2019
@jevansaks jevansaks added the area-DateTimePickers DatePicker, TimePicker, CalendarDatePicker, CalendarView label May 21, 2019
@jevansaks jevansaks moved this from Needs triage to Approved in Controls Triage May 21, 2019
@YuliKl YuliKl added the area-TextBox TextBox, RichEditBox label May 21, 2019
@YuliKl
Copy link

YuliKl commented May 21, 2019

@tbolon - To summarize, you're proposing the ability to type in a date without the need to open any sort of picker. Is that correct? While this capability is relevant for both CalendarDatePicker and DatePicker, you don't need multiple controls that support this? Would a TextBox with date-specific data validation meet your needs? (I'm not proposing that we add more complexity to TextBox, just trying to fully understand your requirements.)

@mdtauk
Copy link
Contributor

mdtauk commented May 21, 2019

What about an IsEditable property on the DatePicker where you can type in a date even when the scrolling pop-up or calendar flyout opens - maybe it can even try to autocomplete as you type?

@tbolon
Copy link
Author

tbolon commented May 22, 2019

To summarize, you're proposing the ability to type in a date without the need to open any sort of picker. Is that correct?

Yes, but more important, to be able to do it quickly.

While this capability is relevant for both CalendarDatePicker and DatePicker, you don't need multiple controls that support this?

Beside the TimePicker, I don't think of other controls which could benefit from easier keyboard input. We could discuss about the sliders which could accept the number pressed by the users (for a slider moving between 1 and 100, if the user press '4' it moves to the value 4, then '0' within a certain delay, it moves to '40'), but I think the date input is the most

Would a TextBox with date-specific data validation meet your needs? (I'm not proposing that we add more complexity to TextBox, just trying to fully understand your requirements.)

It could, but only if the calendar picker is still available, because we don't want to restraint to this type of input. We want to allow users to input values more easily when possible, but still make the control easy to discover.

Also, a TextBox with free typing is not the best method I could think of. See this screenshots from the default winforms DateTimePicker, and how it allows to quickly type values using only the keyboard.

forms
Here I pressed TAB, 1, 0, /, 4, /,1, 8, TAB

forms2
Here I pressed TAB, 1, 9, -, 1, 2,-, 3, 1, TAB

Note that I can also move between date parts using the left and right arrow keys, and that the control recognize a lot of characters are part separator (,, /, -, ...)

I don't want you to use the exact same feature, but I want to emphasis the fact that I could type any date really quick using this interface.

@kikisaints
Copy link

I'm in agreement with @mdtauk here - similar to how we did IsEditable on ComboBox, we could do the same on CalendarDatePicker. Same mental model, wouldn't be introducing any new concepts or controls, and we could still fine-tune it to make sure it was easy and fast to do.

@tbolon
Copy link
Author

tbolon commented May 22, 2019

I just wanted to point that as of now, the control seems to be really focused on mouse/touch input, and barely usable with keyboard only compared to controls available on other UI frameworks.

Of course, adding too much complexity is not desired, as it could be solved with a custom control.

Finding a way to address at least partially this problem without adding any complexity or new controls is the best I could hope :)

@YuliKl YuliKl changed the title Proposal: Keyboard input on CalendarDatePicker Proposal: Ability to type a date into CalendarDatePicker May 22, 2019
@YuliKl YuliKl removed their assignment May 22, 2019
@rapcgutz
Copy link

Use Flyouts for CalendawView the show it when the users click the Calendar Icon and create a separate Textbox for users input and bind the Text Property with Notify property change.

Validate and Format the text every time the users input a new value. hope it help!

@kikisaints
Copy link

Following up on this - I think it's a great suggestion, but at this time we don't have the resources to implement right away because of our WinUI 3.0 effort.

@kikisaints kikisaints removed their assignment May 28, 2019
@kikisaints kikisaints added the needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) label May 29, 2019
@robloo
Copy link
Contributor

robloo commented Jul 27, 2019

I ran across a strong need for this as well. When selecting a date close to today the calendar flyout selection works fine. However, when the date is say 10 years before present, that requires a lot of clicks in the calendar flyout. Additionally, those clicks are not 100% intuitive for all users (navigating back to decade view, etc.).

The ability to type in a date directly will be extremely useful and bring this control more-or-less to parity with WPF's DatePicker.

Some concerns: localization and parsing of the date format must be handled correctly. C++/WinRT and C#/.net have two different ways of handling localization and this is causing concerns with these types of scenarios. (NumberBox as well #483)

@MartyIX
Copy link
Contributor

MartyIX commented Nov 28, 2023

I hit this issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DateTimePickers DatePicker, TimePicker, CalendarDatePicker, CalendarView area-TextBox TextBox, RichEditBox feature proposal New feature proposal needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) team-Controls Issue for the Controls team
Projects
Development

No branches or pull requests

8 participants