From 3e5599e687643094f7c80d0ce99a7c6a0c947e28 Mon Sep 17 00:00:00 2001 From: Chris Villa Date: Wed, 17 Apr 2024 12:39:51 +0100 Subject: [PATCH] perf: add API for disabling auto-scroll due to performance issues --- .../docs/pages/docs/api-reference/components/puck.mdx | 11 ++++++++--- packages/core/components/Puck/index.tsx | 1 + packages/core/types/IframeConfig.tsx | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/docs/pages/docs/api-reference/components/puck.mdx b/apps/docs/pages/docs/api-reference/components/puck.mdx index 0c38512a02..06499686c4 100644 --- a/apps/docs/pages/docs/api-reference/components/puck.mdx +++ b/apps/docs/pages/docs/api-reference/components/puck.mdx @@ -156,9 +156,14 @@ export function Editor() { #### iframe params -| Param | Example | Type | Status | -| --------------------- | ---------------- | ------- | ------ | -| [`enabled`](#enabled) | `enabled: false` | boolean | - | +| Param | Example | Type | Status | +| ----------------------------------------- | ------------------------- | ------- | ------ | +| [`disableAutoScroll`](#disableautoscroll) | `disableAutoScroll: true` | boolean | - | +| [`enabled`](#enabled) | `enabled: false` | boolean | - | + +##### `disableAutoScroll` + +Disable auto-scroll of the iframe when the user drag an item near the edge. ##### `enabled` diff --git a/packages/core/components/Puck/index.tsx b/packages/core/components/Puck/index.tsx index 3f68abf7e8..66dba851be 100644 --- a/packages/core/components/Puck/index.tsx +++ b/packages/core/components/Puck/index.tsx @@ -368,6 +368,7 @@ export function Puck({ }} > { setDraggedItem({ ...draggedItem, ...update }); onDragStartOrUpdate(update); diff --git a/packages/core/types/IframeConfig.tsx b/packages/core/types/IframeConfig.tsx index 3aa7295564..d73a3bc3d1 100644 --- a/packages/core/types/IframeConfig.tsx +++ b/packages/core/types/IframeConfig.tsx @@ -1,3 +1,4 @@ export type IframeConfig = { enabled?: boolean; + disableAutoScroll?: boolean; };