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

Unexpected keyDown behavior with up/down arrow keys #193

Open
panthony opened this issue Jan 29, 2019 · 0 comments
Open

Unexpected keyDown behavior with up/down arrow keys #193

panthony opened this issue Jan 29, 2019 · 0 comments

Comments

@panthony
Copy link
Contributor

Copying the "onKeyDown" behavior for a months selector, I noticed that the behavior is quite unexpected when using down/up arrow.

In the following configuration:

capture d ecran 2019-01-29 a 16 54 10

Pressing 'Up', you would expect the cursor to either:

  • stay in place
  • go back to 25

The actual behavior is to go to 01 because of the following line:

let newIndex = Math.max(index - 7, 0);

Instead of working on the days list, maybe it could use the weeks instead to easily navigate on x/y axis.

Bonus
This logic could be abstracted in an utility function to be reused in other context (month selection, split by quarters).

No need to know about 'days', you can simply expect a list of rows/cells with an id and a isDisabled attribute in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant