Skip to content

Commit 7e8bf96

Browse files
committed
fix: allow-forms for iframe in page header & add id to visible modal
1 parent f5a62ad commit 7e8bf96

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Shared/Components/Header/IframePromoButton.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useCallback } from 'react'
2-
import { GenericEmptyState, VisibleModal } from '@Common/index'
2+
import { GenericEmptyState, stopPropagation, VisibleModal } from '@Common/index'
33
import { ComponentSizeType } from '@Shared/constants'
44
import ReactGA from 'react-ga4'
55
import { ReactComponent as Close } from '@Icons/ic-close.svg'
@@ -25,7 +25,12 @@ export const IframePromoButton = () => {
2525

2626
const renderIframeDrawer = () => (
2727
<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+
>
2934
<div className="trigger-modal__header w-100">
3035
<h1 className="modal__title flex left fs-16 fw-6-imp" data-testid="app-details-url-heading">
3136
{FEATURE_PROMO_EMBEDDED_MODAL_TITLE || FEATURE_PROMO_EMBEDDED_BUTTON_TEXT}
@@ -48,7 +53,8 @@ export const IframePromoButton = () => {
4853
width="100%"
4954
height="100%"
5055
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"
5258
referrerPolicy="no-referrer"
5359
/>
5460
) : (

0 commit comments

Comments
 (0)