Skip to content

Commit

Permalink
EPMRPP-81950 || modal focus issue fix (#3933)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim73i authored Jul 23, 2024
1 parent 5c7f530 commit 46e801d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/src/componentLibrary/modal/modalLayout/modalLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ export const ModalLayout = ({
useEffect(() => {
document.addEventListener('keydown', onKeydown, false);
setShown(true);
if (modalRef && modalRef.current) {
modalRef.current.focus();
}

return () => document.removeEventListener('keydown', onKeydown, false);
}, []);
Expand Down Expand Up @@ -111,6 +108,7 @@ export const ModalLayout = ({
animate={{ opacity: 1, marginTop: modalMargin }}
exit={{ opacity: 0, marginTop: -modalMargin }}
transition={{ duration: 0.3 }}
onAnimationComplete={() => modalRef.current?.focus()}
>
<ModalHeader title={title} headerNode={headerNode} onClose={closeModal} />
<Scrollbars
Expand Down

0 comments on commit 46e801d

Please sign in to comment.