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

Fix tabs list bug - visible focus displayed when clicking out side and then clicking on one tab #537

Merged
merged 33 commits into from
Feb 27, 2022

Conversation

hadasfa
Copy link
Contributor

@hadasfa hadasfa commented Feb 15, 2022

No description provided.

@@ -57,7 +57,7 @@
}

&.tab-focus-visible-inset {
@include focus-style-inset(3px, 3px);
@include focus-style-css-inset(3px, 3px);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the other mixin depend on using focus-visible class name which had different purpose (we inject it when we do real focus for old browsers support)

setFocusTab(-1);
}
const getItemByIndex = useCallback(index => children[index], [children]);
const disabledIndexes = useMemo(() => Array.from(disabledTabIds), [disabledTabIds]);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm probably missing something, but shouldn't disabledTabIds just be called disabledTabIndexes? what's the difference here between an id and an index?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the ids are index but saving in a set object which not support by the hook.


const keyboardContext = useContext(GridKeyboardNavigationContext);

const onArrowNavigation = direction => {
setIsUsingKeyboardNav(true);
isUsingKeyboardNav.current = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

at first I change it to ref because I wanted to add some events and I was afraid from changing react state and renders side effects, but then I saw that there no need to add events.
I keep it as ref because it save some not needed renders but I can undo this change

Hadas Farhi added 2 commits February 23, 2022 08:25
…to bug/hadas/tabs-focus

� Conflicts:
�	src/components/Tabs/TabList/TabList.jsx
@hadasfa hadasfa changed the title Fix tabs list bug - visible focus displayed when clicking out side and then clicking on one tabs Fix tabs list bug - visible focus displayed when clicking out side and then clicking on one tabs (please not merge it yet) Feb 23, 2022
@hadasfa hadasfa changed the title Fix tabs list bug - visible focus displayed when clicking out side and then clicking on one tabs (please not merge it yet) Fix tabs list bug - visible focus displayed when clicking out side and then clicking on one tab Feb 27, 2022
@hadasfa hadasfa merged commit 45977a2 into master Feb 27, 2022
@hadasfa hadasfa deleted the bug/hadas/tabs-focus branch February 27, 2022 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants