Skip to content

Scheduling infrastructure for absolutely everyone.

fix: Embed: data-cal-origin not used by modal(which is used by both element click popup and floating button popup) (#12075)

Hariom Balharaf044c2d7c7e9
diff --git a/packages/embeds/embed-core/src/embed.ts b/packages/embeds/embed-core/src/embed.ts
index df9f27e2e5c..0cb67b3a05a 100644
--- a/packages/embeds/embed-core/src/embed.ts
+++ b/packages/embeds/embed-core/src/embed.ts
@@ -236,7 +236,7 @@ export class Cal {
}: {
calLink: string;
queryObject?: PrefillAndIframeAttrsConfig & { guest?: string | string[] };
- calOrigin?: string;
+ calOrigin: string | null;
}) {
const iframe = (this.iframe = document.createElement("iframe"));
iframe.className = "cal-embed";
@@ -473,10 +473,12 @@ class CalApi {
}
config.embedType = "inline";
+ const calConfig = this.cal.getConfig();
const iframe = this.cal.createIframe({
calLink,
queryObject: withColorScheme(Cal.getQueryObject(config), containerEl),
+ calOrigin: calConfig.calOrigin,
});
iframe.style.height = "100%";
@@ -555,6 +557,7 @@ class CalApi {
modal({
calLink,
config = {},
+ calOrigin,
__prerender = false,
}: {
calLink: string;
@@ -607,6 +610,7 @@ class CalApi {
iframe = this.cal.createIframe({
calLink,
queryObject,
+ calOrigin: calOrigin || null,
});
}