Make the passed element draggable if it overflows left to right. Fires gform-utils/horizontal-drag-started on document when started, and gform-utils/horizontal-drag-ended when drag completes.

Parameters:
NameTypeDescription
elementHTMLElement

The element to make draggable.

Since
  • 1.0.0
Returns:
Type: 
void
Example
import { dragHorizontal, getNodes } from  "@gravityforms/utils";

const initializeDraggable = () => {
	el.containers.forEach( ( exampleParent ) => {
		const target = getNodes(
			'.example',
			false,
			exampleParent,
			true
		)[ 0 ];
		dragHorizontal( target );
	} );
};

Requires