Skip to content

Commit a770b29

Browse files
committed
Some progress
1 parent 52228af commit a770b29

3 files changed

Lines changed: 50 additions & 6 deletions

File tree

packages/docs/docs/flex/props.mdx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,17 @@ Component to use as the drop indicator. It gives a **full control** over the dro
572572

573573
```tsx
574574
type DropIndicatorComponentProps = {
575-
activationProgress: SharedValue<number>;
576-
touchedItemKey: SharedValue<null | string>;
575+
/** Progress of the active item animation (from 0 to 1) */
576+
activeAnimationProgress: SharedValue<number>;
577+
/** Key of the currently dragged item, or null if no item is being dragged */
578+
activeItemKey: SharedValue<null | string>;
579+
/** Current index where the dragged item would be dropped */
577580
dropIndex: SharedValue<number>;
581+
/** Current position where the item would be dropped */
578582
dropPosition: SharedValue<Vector>;
583+
/** Array of item keys in their current order */
579584
orderedItemKeys: SharedValue<Array<string>>;
585+
/** Style to be applied to the drop indicator */
580586
style: ViewStyle;
581587
};
582588
```
@@ -820,6 +826,12 @@ type OrderChangeParams = {
820826

821827
</details>
822828

829+
:::warning
830+
831+
**Don't use** this callback to update items order in state because it's called **frequently** during dragging. Use `onDragEnd` for **state updates** instead.
832+
833+
:::
834+
823835
---
824836

825837
### onDragMove
@@ -883,6 +895,16 @@ You can also use any other haptics library but you will have to trigger haptics
883895

884896
---
885897

898+
### overflow
899+
900+
Controls if the overflowing content should be clipped or visible. Applies only when no item is active.
901+
902+
| type | default | required |
903+
| ----------------------- | ---------- | -------- |
904+
| `'hidden' \| 'visible'` | `'hidden'` | NO |
905+
906+
---
907+
886908
### debug
887909

888910
Enables debug mode, which shows additional views helpful for debugging. This property is intended for the library **developers** and is not recommended for the library **users**.

packages/docs/docs/grid/props.mdx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,17 @@ Component to use as the drop indicator. It gives a **full control** over the dro
456456

457457
```tsx
458458
type DropIndicatorComponentProps = {
459-
activationProgress: SharedValue<number>;
460-
touchedItemKey: SharedValue<null | string>;
459+
/** Progress of the active item animation (from 0 to 1) */
460+
activeAnimationProgress: SharedValue<number>;
461+
/** Key of the currently dragged item, or null if no item is being dragged */
462+
activeItemKey: SharedValue<null | string>;
463+
/** Current index where the dragged item would be dropped */
461464
dropIndex: SharedValue<number>;
465+
/** Current position where the item would be dropped */
462466
dropPosition: SharedValue<Vector>;
467+
/** Array of item keys in their current order */
463468
orderedItemKeys: SharedValue<Array<string>>;
469+
/** Style to be applied to the drop indicator */
464470
style: ViewStyle;
465471
};
466472
```
@@ -704,6 +710,12 @@ type OrderChangeParams = {
704710

705711
</details>
706712

713+
:::warning
714+
715+
**Don't use** this callback to update items order in state because it's called **frequently** during dragging. Use `onDragEnd` for **state updates** instead.
716+
717+
:::
718+
707719
---
708720

709721
### onDragMove
@@ -769,6 +781,16 @@ You can also use any other haptics library but you will have to trigger haptics
769781

770782
---
771783

784+
### overflow
785+
786+
Controls if the overflowing content should be clipped or visible. Applies only when no item is active.
787+
788+
| type | default | required |
789+
| ----------------------- | ---------- | -------- |
790+
| `'hidden' \| 'visible'` | `'hidden'` | NO |
791+
792+
---
793+
772794
### debug
773795

774796
Enables debug mode, which shows additional views helpful for debugging. This property is intended for the library **developers** and is not recommended for the library **users**.

packages/react-native-sortables/src/types/props/shared.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { Animatable, AnimatableProps, Simplify } from '../utils';
1212
* Almost all values are provided as Reanimated shared values for fast updates.
1313
*/
1414
export type DropIndicatorComponentProps = {
15-
/** Progress of the active drag animation (0 to 1) */
15+
/** Progress of the active item animation (from 0 to 1) */
1616
activeAnimationProgress: SharedValue<number>;
1717
/** Key of the currently dragged item, or null if no item is being dragged */
1818
activeItemKey: SharedValue<null | string>;
@@ -22,7 +22,7 @@ export type DropIndicatorComponentProps = {
2222
dropPosition: SharedValue<Vector>;
2323
/** Array of item keys in their current order */
2424
orderedItemKeys: SharedValue<Array<string>>;
25-
/** Style to be applied to the drop indicator (will be merged with the default style) */
25+
/** Style to be applied to the drop indicator */
2626
style: ViewStyle;
2727
};
2828

0 commit comments

Comments
 (0)