Skip to content

Commit

Permalink
fix: hard to move iframe widget #1075
Browse files Browse the repository at this point in the history
  • Loading branch information
Meierschlumpf committed Sep 11, 2024
1 parent 3d4e607 commit 1dddfe7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/widgets/src/iframe/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useI18n } from "@homarr/translation/client";
import type { WidgetComponentProps } from "../definition";
import classes from "./component.module.css";

export default function IFrameWidget({ options }: WidgetComponentProps<"iframe">) {
export default function IFrameWidget({ options, isEditMode }: WidgetComponentProps<"iframe">) {
const t = useI18n();
const { embedUrl, ...permissions } = options;
const allowedPermissions = getAllowedPermissions(permissions);
Expand All @@ -16,7 +16,13 @@ export default function IFrameWidget({ options }: WidgetComponentProps<"iframe">

return (
<Box h="100%" w="100%">
<iframe className={classes.iframe} src={embedUrl} title="widget iframe" allow={allowedPermissions.join(" ")}>
<iframe
style={isEditMode ? { userSelect: "none", pointerEvents: "none" } : undefined}
className={classes.iframe}
src={embedUrl}
title="widget iframe"
allow={allowedPermissions.join(" ")}
>
<Text>{t("widget.iframe.error.noBrowerSupport")}</Text>
</iframe>
</Box>
Expand Down

0 comments on commit 1dddfe7

Please sign in to comment.