fix(iframe): disable scrolling not working (#4017)

This commit is contained in:
Meier Lukas
2025-09-08 16:09:12 +02:00
committed by GitHub
parent ecf1bd98b7
commit 7ac2a81f94
3 changed files with 5 additions and 6 deletions

View File

@@ -98,7 +98,6 @@ const optionMapping: OptionMapping = {
allowMicrophone: (oldOptions) => oldOptions.allowMicrophone, allowMicrophone: (oldOptions) => oldOptions.allowMicrophone,
allowGeolocation: (oldOptions) => oldOptions.allowGeolocation, allowGeolocation: (oldOptions) => oldOptions.allowGeolocation,
allowScrolling: (oldOptions) => oldOptions.allowScrolling, allowScrolling: (oldOptions) => oldOptions.allowScrolling,
allowTransparency: (oldOptions) => oldOptions.allowTransparency,
}, },
video: { video: {
feedUrl: (oldOptions) => oldOptions.FeedUrl, feedUrl: (oldOptions) => oldOptions.FeedUrl,

View File

@@ -27,6 +27,7 @@ export default function IFrameWidget({ options, isEditMode }: WidgetComponentPro
src={embedUrl} src={embedUrl}
title="widget iframe" title="widget iframe"
allow={allowedPermissions.join(" ")} allow={allowedPermissions.join(" ")}
scrolling={options.allowScrolling ? "yes" : "no"}
> >
<Text>{t("widget.iframe.error.noBrowerSupport")}</Text> <Text>{t("widget.iframe.error.noBrowerSupport")}</Text>
</iframe> </iframe>
@@ -71,7 +72,9 @@ const UnsupportedProtocol = () => {
); );
}; };
const getAllowedPermissions = (permissions: Omit<WidgetComponentProps<"iframe">["options"], "embedUrl">) => { const getAllowedPermissions = (
permissions: Omit<WidgetComponentProps<"iframe">["options"], "embedUrl" | "allowScrolling">,
) => {
return objectEntries(permissions) return objectEntries(permissions)
.filter(([_key, value]) => value) .filter(([_key, value]) => value)
.map(([key]) => permissionMapping[key]); .map(([key]) => permissionMapping[key]);
@@ -84,6 +87,4 @@ const permissionMapping = {
allowGeolocation: "geolocation", allowGeolocation: "geolocation",
allowMicrophone: "microphone", allowMicrophone: "microphone",
allowPayment: "payment", allowPayment: "payment",
allowScrolling: "scrolling", } satisfies Record<keyof Omit<WidgetComponentProps<"iframe">["options"], "embedUrl" | "allowScrolling">, string>;
allowTransparency: "transparency",
} satisfies Record<keyof Omit<WidgetComponentProps<"iframe">["options"], "embedUrl">, string>;

View File

@@ -12,7 +12,6 @@ export const { definition, componentLoader } = createWidgetDefinition("iframe",
allowScrolling: factory.switch({ allowScrolling: factory.switch({
defaultValue: true, defaultValue: true,
}), }),
allowTransparency: factory.switch(),
allowPayment: factory.switch(), allowPayment: factory.switch(),
allowAutoPlay: factory.switch(), allowAutoPlay: factory.switch(),
allowMicrophone: factory.switch(), allowMicrophone: factory.switch(),