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

Disabling activeIndex after a non-keyboard interaction #512

Merged
merged 2 commits into from
Feb 3, 2022

Conversation

laviomri
Copy link
Contributor

@laviomri laviomri commented Feb 2, 2022

Task

(Evgeniy's request)
Previously, the keyboard's activeIndex feedback appeared even after selecting items with the mouse. This caused "noise", since mouse-users didn't actually need to see the feedback.
This change shouldn't have any functional effect.

@@ -108,15 +105,27 @@ export default function useGridKeyboardNavigation({
useEventListener({ eventName: "focus", callback: onFocus, ref });
useEventListener({ eventName: "blur", callback: onBlur, ref });

useEffect(() => {
if (activeIndex > -1) {
ref?.current?.focus();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref always exists

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct :) fixed

@laviomri laviomri merged commit 36b78ec into master Feb 3, 2022
@laviomri laviomri deleted the feature/omri/better-feedback-for-mouse-users branch February 3, 2022 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants