Merge pull request #23935 from philnova/patch-1

Add tag to SortEvent in react-sortable-hoc
This commit is contained in:
Armando Aguirre
2018-03-06 18:10:57 -08:00
committed by GitHub
+7 -1
View File
@@ -18,6 +18,12 @@ export interface SortStart {
export type SortEvent = React.MouseEvent<any> | React.TouchEvent<any>;
export type SortEventWithTag = SortEvent & {
target: {
tagName: string
}
};
export type SortStartHandler = (sort: SortStart, event: SortEvent) => void;
export type SortMoveHandler = (event: SortEvent) => void;
@@ -45,7 +51,7 @@ export interface SortableContainerProps {
pressDelay?: number;
pressThreshold?: number;
distance?: number;
shouldCancelStart?: (event: SortEvent) => boolean;
shouldCancelStart?: (event: SortEvent | SortEventWithTag) => boolean;
onSortStart?: SortStartHandler;
onSortMove?: SortMoveHandler;
onSortEnd?: SortEndHandler;