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,
allowGeolocation: (oldOptions) => oldOptions.allowGeolocation,
allowScrolling: (oldOptions) => oldOptions.allowScrolling,
allowTransparency: (oldOptions) => oldOptions.allowTransparency,
},
video: {
feedUrl: (oldOptions) => oldOptions.FeedUrl,

View File

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

View File

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