@johly/vaul-svelte 1.0.0-next.13 → 1.0.0-next.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -167,6 +167,11 @@
167
167
  animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
168
168
  }
169
169
 
170
+ :global([data-vaul-drawer].vaul-dragging),
171
+ :global([data-vaul-drawer].vaul-dragging *) {
172
+ overflow: hidden !important;
173
+ }
174
+
170
175
  :global(
171
176
  [data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="bottom"][data-state="open"]
172
177
  ) {
package/dist/types.d.ts CHANGED
@@ -13,6 +13,7 @@ export type ParentDrawerState = {
13
13
  onNestedDrag: (event: PointerEvent, percentageDragged: number) => void;
14
14
  onNestedRelease: (event: PointerEvent, open: boolean) => void;
15
15
  direction: DrawerDirection;
16
+ readonly isDragging: boolean;
16
17
  };
17
18
  export type AnyFunction = (...args: any) => any;
18
19
  export type Getters<T> = {
@@ -109,10 +109,6 @@ export function useDrawerContent(opts) {
109
109
  const delta = { x: xPosition, y: yPosition };
110
110
  const isAllowedToSwipe = isDeltaInDirection(delta, ctx.direction.current, swipeStartThreshold);
111
111
  if (isAllowedToSwipe) {
112
- // Prevent scrollable content from scrolling while dragging the drawer
113
- if (ctx.isDragging) {
114
- e.preventDefault();
115
- }
116
112
  ctx.onDrag(e);
117
113
  // Prevent parent drawer from receiving the drag event
118
114
  if (ctx.nested.current) {
@@ -167,10 +163,6 @@ export function useDrawerContent(opts) {
167
163
  const delta = { x: xPosition, y: yPosition };
168
164
  const isAllowedToSwipe = isDeltaInDirection(delta, ctx.direction.current, swipeStartThreshold);
169
165
  if (isAllowedToSwipe) {
170
- // Prevent scrollable content from scrolling while dragging the drawer
171
- if (ctx.isDragging) {
172
- e.preventDefault();
173
- }
174
166
  ctx.onDrag(syntheticEvent);
175
167
  // Prevent parent drawer from receiving the touch drag event
176
168
  if (ctx.nested.current) {
@@ -602,6 +602,9 @@ export function useDrawerRoot(opts) {
602
602
  onNestedDrag,
603
603
  onNestedRelease,
604
604
  direction: opts.direction.current,
605
+ get isDragging() {
606
+ return isDragging;
607
+ },
605
608
  };
606
609
  },
607
610
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johly/vaul-svelte",
3
- "version": "1.0.0-next.13",
3
+ "version": "1.0.0-next.15",
4
4
  "license": "MIT",
5
5
  "repository": "github:johanohly/vaul-svelte",
6
6
  "exports": {