Fixed modal blur handler.

pull/924/head
ioedeveloper 4 years ago committed by yann300
parent dc57090e52
commit bbcec763c8
  1. 12
      libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx

@ -40,6 +40,13 @@ export const ModalDialog = (props: ModalDialogProps) => {
handleHide()
}
const handleBlur = (e) => {
if (!e.currentTarget.contains(e.relatedTarget)) {
e.stopPropagation()
handleHide()
}
}
return (
<div
data-id={`${props.id}ModalDialogContainer-react`}
@ -51,10 +58,7 @@ export const ModalDialog = (props: ModalDialogProps) => {
>
<div className="modal-dialog" role="document">
<div
onBlur={(e) => {
e.stopPropagation()
handleHide()
}}
onBlur={handleBlur}
ref={modal}
tabIndex={-1}
className={'modal-content remixModalContent ' + (props.modalClass ? props.modalClass : '')}

Loading…
Cancel
Save