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

Accessibility: keyboard navigation on the toolbar #15054

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions react/features/toolbox/components/web/Toolbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
setHangupMenuVisible,
setOverflowMenuVisible,
setToolbarHovered,
showToolbox
setToolboxVisible
} from '../../actions.web';
import {
getJwtDisabledButtons,
Expand Down Expand Up @@ -193,15 +193,22 @@ export default function Toolbox({
}, [ dispatch ]);

/**
* Toggle the toolbar visibility when tabbing into it.
* Handle focus on the toolbar.
*
* @returns {void}
*/
const onTabIn = useCallback(() => {
if (!toolbarVisible) {
dispatch(showToolbox());
}
}, [ toolbarVisible, dispatch ]);
const handleFocus = useCallback(() => {
dispatch(setToolboxVisible(true));
}, [ dispatch ]);

/**
* Handle blur the toolbar..
*
* @returns {void}
*/
const handleBlur = useCallback(() => {
dispatch(setToolboxVisible(false));
}, [ dispatch ]);

if (iAmRecorder || iAmSipGateway) {
return null;
Expand Down Expand Up @@ -238,7 +245,8 @@ export default function Toolbox({
<div className = { containerClassName }>
<div
className = 'toolbox-content-wrapper'
onFocus = { onTabIn }
onBlur = { handleBlur }
onFocus = { handleFocus }
{ ...(isMobile ? {} : {
onMouseOut,
onMouseOver
Expand Down