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

Focus Zone, ArrowVertical does not take into account input elements that have step defined #258

Open
1951FDG opened this issue Dec 14, 2023 · 9 comments
Assignees
Labels
bug Something isn't working rails react

Comments

@1951FDG
Copy link

1951FDG commented Dec 14, 2023

For ArrowVertical does not take into account input elements of type "number" that have step defined, meaning it overrides the default behaviour making stepping with up and down key no longer working.

I think this can be fixable by adding some code to:

function shouldIgnoreFocusHandling(keyboardEvent: KeyboardEvent, activeElement: Element | null) {

@siddharthkp
Copy link
Member

Hi!

Thanks for taking the time to report this, do you mind creating adding a reproduction of the issue on codesandbox.io or stackblitz.com?

@1951FDG
Copy link
Author

1951FDG commented Dec 15, 2023

Hi!

I hope this helps, since I don't have either

https://jsfiddle.net/2j6nr01x/

@1951FDG
Copy link
Author

1951FDG commented Dec 16, 2023

So to have stepping of the number input working again with up and down arrow key, remove FocusKeys.ArrowVertical

@lesliecdubs lesliecdubs added the bug Something isn't working label Dec 18, 2023
@lesliecdubs
Copy link
Member

@camertron is going to take a quick look to see if we can validate this bug by looking at the test suite and we can go from there.

@camertron
Copy link
Contributor

Hey @1951FDG, I'm not sure what you mean by "remove FocusKeys.ArrowVertical." However I think you were correct to identify shouldIgnoreFocusHandling as the place to make the change. Can you try adding the following code to the end of that function?

if (activeElement instanceof HTMLInputElement && activeElement.type === 'number') {
  return true
}

@1951FDG
Copy link
Author

1951FDG commented Dec 19, 2023

Hey @camertron, cool, I'll look into this as soon as I'm back next year, and maybe submit a pull request for it to be reviewed.

@joshblack
Copy link
Member

Hi all! 👋 Just wanted to check-in to see if this issue is still relevant and close it, if not 👀

@1951FDG
Copy link
Author

1951FDG commented Mar 27, 2024

Hi there, if I make the necessary changes, and submit a pull-request, will it be merged, or are these changes to be made on a per use case.

@keithamus
Copy link
Member

PRs are always welcome, provided there is a motivating use case and the code is clean and well tested 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rails react
Projects
None yet
Development

No branches or pull requests

6 participants