From ee485e6946376bc3927a1ec89fa5560bef342c14 Mon Sep 17 00:00:00 2001 From: Yoan VALLET <ext.sopra.yvallet@grandlyon.com> Date: Fri, 2 Apr 2021 16:49:46 +0200 Subject: [PATCH] feat: disable focus on the main scrollable div --- src/components/App.tsx | 70 +++++++++++++++--------------- src/components/Content/Content.tsx | 1 - 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 59fa3dad5..af33ff016 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1,35 +1,35 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import React from 'react' -import { HashRouter } from 'react-router-dom' -import { createBrowserHistory } from 'history' -import { Layout, Main, Content } from 'cozy-ui/transpiled/react/Layout' - -import Routes from 'components/Routes/Routes' -import Navbar from 'components/Navbar/Navbar' -import SplashRoot from './Splash/SplashRoot' -import SplashScreen from 'components/Splash/SplashScreen' -import SplashScreenError from 'components/Splash/SplashScreenError' - -export const history = createBrowserHistory() - -export const App = () => { - return ( - <HashRouter {...history}> - <Layout> - <SplashRoot - splashComponent={SplashScreen} - splashErrorComponent={SplashScreenError} - > - <Navbar /> - <Main> - <Content className="app-content"> - <Routes /> - </Content> - </Main> - </SplashRoot> - </Layout> - </HashRouter> - ) -} - -export default App +/* eslint-disable @typescript-eslint/no-explicit-any */ +import React from 'react' +import { HashRouter } from 'react-router-dom' +import { createBrowserHistory } from 'history' +import { Layout, Main, Content } from 'cozy-ui/transpiled/react/Layout' + +import Routes from 'components/Routes/Routes' +import Navbar from 'components/Navbar/Navbar' +import SplashRoot from './Splash/SplashRoot' +import SplashScreen from 'components/Splash/SplashScreen' +import SplashScreenError from 'components/Splash/SplashScreenError' + +export const history = createBrowserHistory() + +export const App = () => { + return ( + <HashRouter {...history}> + <Layout> + <SplashRoot + splashComponent={SplashScreen} + splashErrorComponent={SplashScreenError} + > + <Navbar /> + <Main> + <Content className="app-content" tabIndex="-1"> + <Routes /> + </Content> + </Main> + </SplashRoot> + </Layout> + </HashRouter> + ) +} + +export default App diff --git a/src/components/Content/Content.tsx b/src/components/Content/Content.tsx index 1ef4edf6d..dad914856 100644 --- a/src/components/Content/Content.tsx +++ b/src/components/Content/Content.tsx @@ -110,7 +110,6 @@ const Content: React.FC<ContentProps> = ({ handleCloseClick={handleFeedbackModalClose} /> <div - role="main" className="content-view" style={{ marginTop: height, -- GitLab