diff --git a/package.json b/package.json index be8c27d80..3bf68321b 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "emoji-mart": "^5.5.2", "filesize": "3.6.1", "firstline": "1.2.1", + "focus-trap-react": "^10.2.3", "fs-extra": "9.0.0", "glob": "7.1.2", "image-type": "^4.1.0", diff --git a/ts/components/SessionWrapperModal.tsx b/ts/components/SessionWrapperModal.tsx index c75a64c0d..fd2aaef87 100644 --- a/ts/components/SessionWrapperModal.tsx +++ b/ts/components/SessionWrapperModal.tsx @@ -1,5 +1,6 @@ -import React, { useRef } from 'react'; import classNames from 'classnames'; +import FocusTrap from 'focus-trap-react'; +import React, { useRef } from 'react'; import useKey from 'react-use/lib/useKey'; import { SessionIconButton } from './icon'; @@ -63,68 +64,72 @@ export const SessionWrapperModal = (props: SessionWrapperModalType) => { }; return ( -
-
-
- {showHeader ? ( -
-
- {showExitIcon ? ( - - ) : null} + +
+ {/* FocusTrap needs a button always mounted as a start, which is apparently not our case */} +