From 763c1347f1eac4f3d6f07dcdeb14e31f68cc908f Mon Sep 17 00:00:00 2001 From: Michael Handley Date: Wed, 21 Jun 2017 18:09:37 -0700 Subject: [PATCH] Test typings for 0.6.3 update --- .../react-sortable-hoc-tests.tsx | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/types/react-sortable-hoc/react-sortable-hoc-tests.tsx b/types/react-sortable-hoc/react-sortable-hoc-tests.tsx index 4700612d01..af742734bf 100644 --- a/types/react-sortable-hoc/react-sortable-hoc-tests.tsx +++ b/types/react-sortable-hoc/react-sortable-hoc-tests.tsx @@ -35,21 +35,38 @@ const SortableList = ReactSortableHOC.SortableContainer((props: SortableListProp class SortableComponent extends React.Component<{}, SortableComponentState> { private _onSortEnd: ReactSortableHOC.SortEndHandler; - private _handleSotEnd(sort: ReactSortableHOC.SortEnd, event: ReactSortableHOC.SortEvent): void { + private _handleSortEnd(sort: ReactSortableHOC.SortEnd, event: ReactSortableHOC.SortEvent): void { this.setState({items: ReactSortableHOC.arrayMove(this.state.items, sort.oldIndex, sort.newIndex)}); } + private _getHelperDimensions(sort: ReactSortableHOC.SortStart): ReactSortableHOC.Dimensions { + if (sort.node instanceof HTMLElement) { + return ({ + width: sort.node.offsetWidth, + height: sort.node.offsetHeight + }); + } + return {width: 0, height: 0}; + } + public constructor() { super(); this.state = { items: ['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5', 'Item 6'], axis: 'x' }; - this._onSortEnd = this._handleSotEnd.bind(this); + this._onSortEnd = this._handleSortEnd.bind(this); } public render(): JSX.Element { - return ; + return ; } }