This commit is contained in:
Sultan committed 2022-06-23 01:58:17 +03:00
1 parent 9a08533b19
commit d94e8a4e16
1 file changed
+2 -3
@@ -10,10 +10,9 @@
*/
export const numericGestureControl = (targetNode, {
initialValue = 0,
direction = 'horizontal' || 'vertical',
onValueChange = ({value = 0, preventDefault = () => null}) => null,
direction = 'horizontal',
onValueChange,
}) => {
const {ownerDocument} = targetNode;
const eventNames = [ 'pointerup', 'pointerdown', 'pointermove' ];
const state = { type: '', value: initialValue, cursor: direction === 'horizontal' ? 'ew-resize' : 'ns-resize' };
const handleEvent = ({ type, target, movementY, movementX, pointerId, pressure }) => {