Skip to content

Commit

Permalink
feat: add stopPropagation prop
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Jul 28, 2022
1 parent e99d94f commit 3ce54e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default {
hideDefaultLines: Boolean,
props: Object,
flushSync: Function,
stopPropagation: Boolean,
} as const,
events: {} as const,
};
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export function getAbleGesto(

if (!result) {
e.stop();
} else if (eventType === "Start" && isControl) {
} else if (moveable.props.stopPropagation || (eventType === "Start" && isControl)) {
e?.inputEvent?.stopPropagation();
}
});
Expand Down
5 changes: 5 additions & 0 deletions packages/react-moveable/src/react-moveable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ export interface DefaultOptions {
* @default false
*/
hideDefaultLines?: boolean;
/**
* Whether to prevent bubbling of events like mousedown, touchstart, etc.
* @default false
*/
stopPropagation?: boolean;
/**
* You can use props in object format or custom props.
* @default empty object
Expand Down

0 comments on commit 3ce54e0

Please sign in to comment.