Example #1
0
	/**
	 * Assigns DOM node of the rendered component as an instance property.
	 *
	 * @param {Element} ref Rendered component reference.
	 */
	bindNode( ref ) {
		// Disable reason: Because render clones the child, we don't know what
		// type of element we have, but if it's a DOM node, we want to observe
		// the disabled attribute.
		// eslint-disable-next-line react/no-find-dom-node
		this.node = findDOMNode( ref );
	}
Example #2
0
				this.props.setTimeout( () => {
					// We need a generic way to access the panel's container
					// eslint-disable-next-line react/no-find-dom-node
					scrollIntoView( findDOMNode( this.panels[ panel ] ), this.inserterResults.current, {
						alignWithTop: true,
					} );
				} );
Example #3
0
	bindBlockNode( node ) {
		// Disable reason: The block element uses a component to manage event
		// nesting, but we rely on a raw DOM node for focusing.
		//
		// eslint-disable-next-line react/no-find-dom-node
		this.node = findDOMNode( node );
	}
Example #4
0
	componentDidMount() {
		window.addEventListener( 'dragover', this.dragOverListener );
		window.addEventListener( 'drop', this.onDrop );
		window.addEventListener( 'mouseup', this.resetDragState );

		// Disable reason: Can't use a ref since this component just renders its children
		// eslint-disable-next-line react/no-find-dom-node
		this.container = findDOMNode( this );
	}
Example #5
0
	setBlockListRef( node ) {
		// Disable reason: The root return element uses a component to manage
		// event nesting, but the parent block list layout needs the raw DOM
		// node to track multi-selection.
		//
		// eslint-disable-next-line react/no-find-dom-node
		node = findDOMNode( node );

		this.wrapperNode = node;

		this.props.blockRef( node, this.props.uid );
	}
Example #6
0
	bindNode( ref ) {
		// Disable reason: Need DOM node for finding first focusable element
		// on keyboard interaction to shift to toolbar.
		// eslint-disable-next-line react/no-find-dom-node
		this.toolbar = findDOMNode( ref );
	}