Skip to content

Commit

Permalink
fix: add originZone from getContext
Browse files Browse the repository at this point in the history
  • Loading branch information
sebkolind committed Jul 26, 2024
1 parent dc87cb7 commit 707c701
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type Options = {
};

type CustomShadow = {
el: HTMLElement;
el: HTMLElement | null;
/**
* The drag offset from the top left corner of the element.
* @default { x: 0, y: 0 }
Expand All @@ -111,8 +111,10 @@ type CustomShadow = {

type EventHandler<T = void> = (
event: Event,
context: Pick<Context, "origin" | "zone"> &
Partial<Pick<Context, "shadow" | "multiple" | "zones">>,
context: Pick<
Context,
"origin" | "zone" | "zones" | "originZone" | "shadow" | "multiple"
>,
) => T;

export { Context, Options };
3 changes: 2 additions & 1 deletion lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ const isElement = (target: EventTarget | null): target is HTMLElement => {
};

const getContext = (context: Context) => {
const { origin, zone, shadow, multiple, zones } = context;
const { origin, zone, originZone, shadow, multiple, zones } = context;

return {
origin,
originZone,
zone,
shadow,
multiple,
Expand Down

0 comments on commit 707c701

Please sign in to comment.