Clay: [Date Picker] Unexpected behavior using keyboard arrows

Created on 10 Mar 2021  路  7Comments  路  Source: liferay/clay

Reviewing the current behavior of the date picker component I noticed that the calendar behaves in a different way I expected:

focus-jump-using-keyboard

Steps to Reproduce

  1. Open the calendar
  2. Click on a date
  3. Click on the input (to change manually the date)
  4. Press the right arrow 鉃★笍
  5. Click on the input (to change manually the date)
  6. Press the right arrow 鉃★笍
  7. ~Delete the date~

Expected behavior

  1. Pressing 猬咃笍 鉃★笍 moves left/right one char position the cursor

  2. Besides, when the cursor is placed:

AT THE START of the string:

  • Pressing 猬嗭笍 or 猬咃笍: nothing
  • Pressing 猬囷笍 : move the cursor to the end of the string

AT THE END of the string:

  • Pressing 猬嗭笍 : move the cursor to the start of the string
  • Pressing 猬囷笍 or 鉃★笍 : nothing

cc\ @marcoscv-work

3.x clay-components bug

Most helpful comment

Yeah, it won't cause so much trouble because we still have the focus. But yes, we need more details about the behavior of focus in Date Picker so that we can improve this in Date Picker and maybe also for Color Picker.

Some libraries implement different focus behaviors on Date Picker, when there is a little time left (when passing this migration that I'm working on), I can bring up some use cases so that we can think about it more.

All 7 comments

I think this is related to the focus control that we have enabled for Date Picker to also use the arrow keys, I think we can disable it for now.

I thought the keyboard support for the "calendar" is important. Are you suggesting disabling that? that will deteriorate the accessibility of the component, isn't it?

Well, partially, what I am suggesting would be to disable the focus via the arrows but it will still allow the focus with tab and tab + shift.

I'm still not sure of doing it but if you see it clear, go on.

ps. We should have the focus behavior defined, but I'm afraid we don't have it.

Probably we would need to disable the current focus control and create a specific behavior for data piker

Yeah, it won't cause so much trouble because we still have the focus. But yes, we need more details about the behavior of focus in Date Picker so that we can improve this in Date Picker and maybe also for Color Picker.

Some libraries implement different focus behaviors on Date Picker, when there is a little time left (when passing this migration that I'm working on), I can bring up some use cases so that we can think about it more.

This issue has been merged and will be released in DXP at https://issues.liferay.com/browse/LPS-128920

Was this page helpful?
0 / 5 - 0 ratings

Related issues

julien picture julien  路  3Comments

drakonux picture drakonux  路  4Comments

kresimir-coko picture kresimir-coko  路  3Comments

dgarciasarai picture dgarciasarai  路  3Comments

bryceosterhaus picture bryceosterhaus  路  4Comments