From c39561eb4bbb305fbc92ebe5ca43fae540482fa0 Mon Sep 17 00:00:00 2001 From: nikitasingla Date: Wed, 23 Nov 2022 22:14:44 +0530 Subject: [PATCH] made change in dnd kit documentation for the autoScroll prop --- api-documentation/context-provider/README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/api-documentation/context-provider/README.md b/api-documentation/context-provider/README.md index ad5d94c..8712e6e 100644 --- a/api-documentation/context-provider/README.md +++ b/api-documentation/context-provider/README.md @@ -57,7 +57,7 @@ If multiple `DndContext` providers are listening for the same event, events will ```typescript interface Props { announcements?: Announcements; - autoScroll?: boolean; + autoScroll?: boolean | AutoScrollOptions; cancelDrop?: CancelDrop; children?: React.ReactNode; collisionDetection?: CollisionDetection; @@ -71,6 +71,20 @@ interface Props { onDragEnd?(event: DragEndEvent): void; onDragCancel?(): void; } + +interface AutoScrollOptions { + acceleration?: number; + activator?: AutoScrollActivator; + canScroll?: CanScroll; + enabled?: boolean; + interval?: number; + layoutShiftCompensation?: boolean | {x: boolean, y: boolean}; + order?: TraversalOrder; + threshold?: { + x: number; + y: number; + }; +} ``` ### Event handlers @@ -156,7 +170,7 @@ Use the `screenReaderInstructions` prop to customize the instructions that are r ### Autoscroll -Use the optional `autoScroll` boolean prop to temporarily or permanently disable auto-scrolling for all sensors used within this `DndContext`. +Use the optional `autoScroll` prop to temporarily or permanently disable auto-scrolling for all sensors used within this `DndContext`. Auto-scrolling may also be disabled on an individual sensor basis using the static property `autoScrollEnabled` of the sensor. For example, the [Keyboard sensor](../sensors/keyboard.md) manages scrolling internally, and therefore has the static property `autoScrollEnabled` set to `false`.