nextcloud-libraries / nextcloud-vue

🍱 Vue.js components for Nextcloud app development ✌ https://npmjs.org/@nextcloud/vue
https://nextcloud-vue-components.netlify.app/
Other
215 stars 85 forks source link

[BITV/A11Y] Datetime picker UX needs to be improved. #1666

Closed marcoambrosini closed 2 years ago

marcoambrosini commented 3 years ago

Feature request

Setting date and time with our current picker is very expensive and creates a lot of friction. I think we need to go back to the drawing board and come up with something better!

To do

Replacing the current datepicker with a native obehavourne

Native date picker limitations

Chrome: it is possible to pick a week, but mostly not possible to change the week from a keyboard.

Peek 2022-08-26 10-17

Firefox: almost unusable. Neither keyboard nor picker (mouse)

Peek 2022-08-26 10-18

Chrome: doesn't work at all.

Firefox: works only for keyboard input.

Peek 2022-08-26 10-29

Firefox: It is not possible to use a piker via keyboard at all. Peek 2022-08-26 10-36

Firefox: focus doesn't work at all.

Chrome: I don't know how could it be possible to listen a "close" event from native picker on ActionMenu. First Esc goes to previous date. Second Esc closes action menu completely. See more https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#events.

Peek 2022-08-26 10-42

Firefox 103.0.1 (64-bit) desktop

Tested on Linux using https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local

Missing picker for time

Picking date Picking time
Bildschirmfoto vom 2022-08-17 12-15-29 Bildschirmfoto vom 2022-08-17 12-15-44

UC Browser several versions

Buggy + seems too old. image

Safari iOS older versions

Buggy. Can't open picker + can't put a date via input. Not usable. image

Safari iOS v12

Partly usable. User is not able to choose year + month.

Safari iOS v13

Partly usable. User is not able to choose year + month.

image

Safari Desktop v12 + Safari Desktop v13.1

Buggy. Can't open picker + can't put a date via input. Not usable. image

Chrome Version 104.0.5112.101 (Official Build) (64-bit) desktop

Colors of disabled dates have too low contrast

Chrome Desktop: Colors of disabled dates have too low contrast (some days in month are disabled and input field shows it in this way). Icon on the right side have too low contrast too.

image

raimund-schluessler commented 3 years ago

@ma12-co Could elaborate what bothers you?

marcoambrosini commented 3 years ago

@raimund-schluessler this came out in one of our open design calls and I left this here as a reminder. I don't remember the specifics but we found various counter-intuitive things about it and some unnecessary steps.

JuliaKirschenheuter commented 2 years ago

I see there several problems regarding navigation via keyboard:

  1. Navigation order: double left -> left -> double right -> right -> month -> year -> OK

image

  1. Datetime picker body is completely inaccessible

In this point there should be done also a lot:

image

  1. All icons must have descriptions

  2. It is not possible to quit a Datetime picker via keyboard.

Datetime picker as a popover

Datetime picker as a popover is completely inaccessible via keyboard: ActionInput type="datetime-local". Popover will gone by the next tabulation.

Probably would be better solution to check existing implementations of Datetime picker and use a modern / accessible one rather than use this one https://github.com/mengxiong10/vue2-datepicker

PVince81 commented 2 years ago

see also https://github.com/mengxiong10/vue2-datepicker/issues/684

JuliaKirschenheuter commented 2 years ago

@marcoambrosini, @skjnldsv what is your opinion, how could we move on?

raimund-schluessler commented 2 years ago

@marcoambrosini, @skjnldsv what is your opinion, how could we move on?

* wait until upstream ticket will be closed?

* search for another library?

Searching for another library is not a good idea, I think (unless the current one is abandoned/deprecated, which it isn't). I would rather try to fix the issue in the upstream library.

marcoambrosini commented 2 years ago

I think needs some design and usability research @jancborchardt & @nimishavijay

ChristophWurst commented 2 years ago

@JuliaKirschenheuter is currently investigating how much effort it would be to fix the existing upstream lib. As alternative approaches she will research if there are other capable (and hopefully accessible) Vue date picker options. And lastly, if both of those are too much work, how much effort it would be to create an accessible date picker from scratch.

Based on that information we'll take a decision on how to move forward with this topic.

JuliaKirschenheuter commented 2 years ago

There are 3 ways, how could we move forwards with Datetime picker:

Me and @st3iny researched around. There are so many different datetime pickers, but most of them are not accessible. There are 2 options, which we could use:

Native datetime picker

Pro:

Contra:

Please have a look at https://www.hassellinclusion.com/blog/input-type-date-ready-for-use/ https://a11ysupport.io/tech/html/input(type-datetime-local)_element

image image

Vaadin web component datetime picker

Pro:

Contra:

image

See more:

https://github.com/vaadin/web-components https://www.npmjs.com/package/@vaadin/vaadin-date-time-picker https://cdn.vaadin.com/vaadin-web-components/23.2.0-alpha3/#/elements/vaadin-date-time-picker#property-i18n https://github.com/vaadin/web-components/tree/master/packages/date-time-picker


@nextcloud/frontenders please feel free to add something there. @nextcloud/designers please feel free to add something there.

I've talked to @jancborchardt: preference is on native datetime picker

CarlSchwan commented 2 years ago

personally I also prefer a native datetime picker, this also makes things like mobile support easier.

jancborchardt commented 2 years ago

Yeah, even though there are certain drawbacks for the native datetime picker, there are way more for all these 3rdparty libraries.

And then it’s as expected on the platform, just like we also do with our native font stack because custom fonts just resulted in too many issues. A big reason for datepicker libraries was bad browser support, but now that this is mostly fixed and often much better (especially on iOS and Android), it’s better to go with native & standard.

dartcafe commented 2 years ago

While reading through this issue, I would like to understand, why the datetime picker has to be accessible. At least if this addresses accessibility to visually disabled people, I would guess that they would prefer a textfield rather than a picker.

Is that an issue, which is addressed from affected ones, or the result of a review?

Maybe I didn't get the intention right, but I would like to understand that.

ChristophWurst commented 2 years ago

There are 3 ways, how could we move forwards with Datetime picker

At the moment it does look like the native date time picker is the most promising option, so we will try that approach.

As a short term todo we need to compile a list of browsers that we support and test each of them with an example of such native datepicker to capture a snapshot of the current browser capability, the accessibility, design and so on. As an example, we noticed that the Firefox date time picker does only have an input menu for the date, not for the time or am/pm switch. Wherever we find lack of feature/accessibility/etc we should document these limitations and see if there are known limitations or workarounds for those browsers. That means, with the given example, searching the Mozilla tracker for any related tickets and checking their status. If we do not find any blockers then we can proceed with this migration.

AndyScherzinger commented 2 years ago

@dartcafe we got 2 external reviews from external in a11y specializing companies and also customers raised a11y issues. The goal is to work on closing the gap to the various a11y standards like WCAG21. and BITV2.0.

JuliaKirschenheuter commented 2 years ago

I'm still a bit unsure if we should use native date time picker, because there are some important accessibility issues especially in Firefox =(

There is an official overview of bugs:

https://bugzilla.mozilla.org/buglist.cgi?quicksearch=date+picker https://bugzilla.mozilla.org/buglist.cgi?quicksearch=datetime+local

But i think it is still the best solution we have for now. The next step could be to create our own datetime picker, but this needs much time (desktop, mobile, all accessibility requirements: navigation, shortcuts, zooming, contrasts, labeling) + tests.

@AndyScherzinger, @ChristophWurst should i start to replace all our datetime pickers?

AndyScherzinger commented 2 years ago

@JuliaKirschenheuter since it is still the best option, yes 👍

AndyScherzinger commented 2 years ago

Also did we make sure the native picker is available on all currently supported browsers by Nextcloud?

JuliaKirschenheuter commented 2 years ago

Also did we make sure the native picker is available on all currently supported browsers by Nextcloud?

Yes, https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#browser_compatibility But as i said before native datetime picker have some accessibility problems / bugs in Firefox.

PVince81 commented 2 years ago

I've documented my struggles with the current date picker: https://github.com/nextcloud/calendar/issues/4414

Even if we swap one out, it would be good to keep these in mind so that we don't have the same problems. I found having a "Pick date" button in the footer not intuitive.

JuliaKirschenheuter commented 2 years ago

I'm currently working on correct integration a native datetime picker into ActionInput and there are some places to fix:

ChristophWurst commented 2 years ago

A draft of the new picker can be found at https://github.com/nextcloud/nextcloud-vue/pull/3063. Early feedback appreciated.

ChristophWurst commented 2 years ago

Is that the case for every browser? Could you please add the limitations to https://github.com/nextcloud/nextcloud-vue/issues/1666#issue-784236372?