Skip to content

Commit

Permalink
add focus and blur handle to the toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadkadri committed Aug 26, 2024
1 parent ec22c1f commit 59e1a2e
Showing 1 changed file with 16 additions and 8 deletions.
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

0 comments on commit 59e1a2e

Please sign in to comment.