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

RTL cursor and keyboard behavior prevents intuitive editing of the date value in Input Date Picker #7186

Closed
eriklharper opened this issue Jun 15, 2023 · 6 comments
Assignees
Labels
1 - assigned Issues that are assigned to a sprint and a team member. ArcGIS Online Issues logged by ArcGIS Online team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 5 A few days of work, definitely requires updates to tests. i18n-l10n issues dealing with internationalization/localization impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - low Issue is non core or affecting less that 10% of people using the library research Issues that require more in-depth research or multiple team members to resolve or make decision.

Comments

@eriklharper
Copy link
Contributor

eriklharper commented Jun 15, 2023

Actual Behavior

In RTL mode, it is difficult to edit portions of the date value with the keyboard in Input Date Picker's input field because the cursor jumps around unexpectedly when editing the value or moving the cursor with the arrow keys. The left arrow key in certain places will move to the right (and the right arrow key moves to the left), such as within moving the cursor between groups of numbers, but in other cases moves the cursor in the same direction as indicated by the key, such as when moving the cursor on either side of the / separator between the date values.

The Backspace key also doesn't always work as expected. Sometimes hitting backspace will actually remove characters and sometimes it won't depending on the cursor position. Sometimes hitting the Delete key will remove a character when the Backspace key doesn't.

Originally posted about here:

          > I _think_ this is fixed now on the latest `1.4.1`. @Olga8614 would you be able to re-verify this with the latest calcite version? I forked Franco's codepen with the latest calcite and my keyboard edits are working after changing the value and pressing enter or blurring the input:

https://codepen.io/eriklharper/pen/wvYVvzE

The year can be edited from the keyboard - fixed
The day input from the keyboard still does not take effect - not fixed

image

Originally posted by @Olga8614 in #4569 (comment)

Expected Behavior

  • The left arrow key should always move the cursor to the left, regardless of text direction
  • The right arrow key should always move the cursor to the right, regardless of text direction
  • The Backspace (and Delete) keys should always remove the character to the right of the cursor in RTL mode and always remove the character to the left in LTR mode.

Reproduction Sample

https://codepen.io/eriklharper/pen/wvYVvzE

Reproduction Steps

  1. Click into the input with the mouse or tab into it to focus it with the keyboard
  2. Hit the left and right arrow keys to move the cursor around
  3. Notice that it jumps around unexpectedly and doesn't consistently go where you think it should go
  4. Hit Backspace in different spots of the value
  5. Notice that it doesn't always remove characters and doesn't always remove the characters you expect. It also will remove some characters that aren't adjacent to the cursor

Reproduction Version

1.4.0

Relevant Info

This seems to happen consistently on all browsers, but there could be slight variations in behavior across some.

Regression?

No

Priority impact

p2 - want for current milestone

Impact

No response

Esri team

ArcGIS Online

@eriklharper eriklharper added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Jun 15, 2023
@github-actions github-actions bot added impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone ArcGIS Online Issues logged by ArcGIS Online team members. labels Jun 15, 2023
@eriklharper eriklharper added i18n-l10n issues dealing with internationalization/localization estimate - 5 A few days of work, definitely requires updates to tests. labels Jun 15, 2023
@eriklharper eriklharper self-assigned this Jun 15, 2023
@eriklharper eriklharper added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Jun 15, 2023
@eriklharper eriklharper added the research Issues that require more in-depth research or multiple team members to resolve or make decision. label Jun 15, 2023
@eriklharper
Copy link
Contributor Author

This article explains in detail why some of this behavior occurs in the browser: https://marijnhaverbeke.nl/blog/cursor-in-bidi-text.html

@geospatialem geospatialem removed the needs triage Planning workflow - pending design/dev review. label Jun 21, 2023
@geospatialem geospatialem added this to the 2023 July Priorities milestone Jun 21, 2023
@geospatialem geospatialem added the p - low Issue is non core or affecting less that 10% of people using the library label Jun 21, 2023
@jcfranco
Copy link
Member

jcfranco commented Jul 3, 2023

@annierm18 Could you confirm the expected behavior from the description is the desired approach? Genuinely curious because this is something I've noticed before in other UI libraries and thought it was by design due to the BiDi algorithm.

@eriklharper
Copy link
Contributor Author

eriklharper commented Jul 3, 2023

@annierm18 Could you confirm the expected behavior from the description is the desired approach? Genuinely curious because this is something I've noticed before in other UI libraries and thought it was by design due to the BiDi algorithm.

I got confirmation from Cecilia Sung in the Internationalization Services Teams Channel here:

image

@jcfranco
Copy link
Member

jcfranco commented Jul 3, 2023

@eriklharper Awesome, thanks for confirming. 🏆

@annierm18
Copy link
Contributor

Yes, thanks @eriklharper! Let us know if you need any more info :)

@jcfranco
Copy link
Member

Per today's check-in, closing as this won't be applicable once input masking is implemented (see #8624). We can revisit in the future based on user feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - assigned Issues that are assigned to a sprint and a team member. ArcGIS Online Issues logged by ArcGIS Online team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 5 A few days of work, definitely requires updates to tests. i18n-l10n issues dealing with internationalization/localization impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - low Issue is non core or affecting less that 10% of people using the library research Issues that require more in-depth research or multiple team members to resolve or make decision.
Projects
None yet
Development

No branches or pull requests

5 participants