Skip to content

Commit

Permalink
Remove focus ref
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentC35 committed Nov 7, 2023
1 parent c3ccf96 commit 49519d2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
4 changes: 0 additions & 4 deletions queen-v2/src/components/lightOrchestrator/header/header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ButtonBase, IconButton } from '@material-ui/core';
import { useRef } from 'react';
import { SIMPLE_CLICK_EVENT, paradataHandler } from 'utils/events';

import { ExitToApp } from '@material-ui/icons';
Expand All @@ -25,7 +24,6 @@ const Header = ({
}) => {
const classes = useStyles({ standalone });
const setToFirstPage = useConstCallback(() => setPage('1'));
const quitButtonRef = useRef();

const utilInfo = type => {
return {
Expand All @@ -37,7 +35,6 @@ const Header = ({
const { sequence, subSequence } = hierarchy;

const quitShortCut = () => {
if (quitButtonRef && quitButtonRef.current) quitButtonRef.current.focus();
quit();
};

Expand Down Expand Up @@ -78,7 +75,6 @@ const Header = ({
<>
<div className={classes.headerClose}>
<IconButton
ref={quitButtonRef}
title={D.simpleQuit}
className={classes.closeIcon}
onClick={paradataHandler(quit)(utilInfo('end-survey'))}
Expand Down
10 changes: 0 additions & 10 deletions queen-v2/src/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
export { default as addOnlineStatusObserver } from './online-status-observer';
export const getPercent = (n, length) => Math.round((100 * n) / length);

export const goToTopPage = topRef => {
if (topRef && topRef.current) {
topRef.current.tabIndex = -1;
topRef.current.focus();
topRef.current.blur();
window.scrollTo({ top: 0 });
topRef.current.removeAttribute('tabindex');
}
};

0 comments on commit 49519d2

Please sign in to comment.