1
1
import { useState , useCallback } from 'react'
2
- import { GenericEmptyState , VisibleModal } from '@Common/index'
2
+ import { GenericEmptyState , stopPropagation , VisibleModal } from '@Common/index'
3
3
import { ComponentSizeType } from '@Shared/constants'
4
4
import ReactGA from 'react-ga4'
5
5
import { ReactComponent as Close } from '@Icons/ic-close.svg'
@@ -25,7 +25,12 @@ export const IframePromoButton = () => {
25
25
26
26
const renderIframeDrawer = ( ) => (
27
27
< VisibleModal close = { onClickCloseIframeModal } >
28
- < div className = "modal-body--ci-material h-100 dc__overflow-hidden dc__border-left flex column dc__content-space w-100" >
28
+ < div
29
+ className = "modal-body--ci-material h-100 dc__overflow-hidden dc__border-left flex column dc__content-space w-100"
30
+ // NOTE: needed to prevent closing of modal on body click; clicking outside this div
31
+ // will close the modal (outside click handled)
32
+ onClick = { stopPropagation }
33
+ >
29
34
< div className = "trigger-modal__header w-100" >
30
35
< h1 className = "modal__title flex left fs-16 fw-6-imp" data-testid = "app-details-url-heading" >
31
36
{ FEATURE_PROMO_EMBEDDED_MODAL_TITLE || FEATURE_PROMO_EMBEDDED_BUTTON_TEXT }
@@ -48,7 +53,8 @@ export const IframePromoButton = () => {
48
53
width = "100%"
49
54
height = "100%"
50
55
className = "dc__no-border"
51
- sandbox = "allow-same-origin allow-scripts"
56
+ // NOTE: allow-forms is required to enable submitting the form
57
+ sandbox = "allow-same-origin allow-scripts allow-forms"
52
58
referrerPolicy = "no-referrer"
53
59
/>
54
60
) : (
0 commit comments