How to use the dom-lib.getContainer function in dom-lib

To help you get started, we’ve selected a few dom-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rsuite / rsuite / src / fixtures / Position.js View on Github external
const target = this.getTargetSafe();

        if (!this.props.shouldUpdatePosition && target === this._lastTarget && !placementChanged) {
            return;
        }

        this._lastTarget = target;

        if (!target) {
            this.setState({positionLeft: 0, positionTop: 0, arrowOffsetLeft: null, arrowOffsetTop: null});

            return;
        }

        const overlay = ReactDOM.findDOMNode(this);
        const container = getContainer(this.props.container, ownerDocument(this).body);

        this.setState(overlayPositionUtils.calcOverlayPosition(this.props.placement, overlay, target, container, this.props.containerPadding));
    }
}
github rsuite / rsuite / src / WhisperPortal.js View on Github external
setContainer = (props: Props = this.props) => {
    this.portalContainerNode = getContainer(
      props.container, ownerDocument(this).body,
    );
  }
github rsuite / rsuite / src / fixtures / BaseModal.js View on Github external
onShow() {
        let doc = ownerDocument(this);
        let container = getContainer(this.props.container, doc.body);


        modalManager.add(this, container, this.props.containerClassName);
        this._onDocumentKeyupListener = on(doc, 'keyup', this.handleDocumentKeyUp);
        this._onFocusinListener = onFocus(this.enforceFocus);

        this.focus();

        if (this.props.onShow) {
            this.props.onShow();
        }
    },
github rsuite / rsuite / src / fixtures / Portal.js View on Github external
componentWillReceiveProps(nextProps) {

        if (this._overlayTarget && nextProps.container !== this.props.container) {
            this._portalContainerNode.removeChild(this._overlayTarget);
            this._portalContainerNode = getContainer(nextProps.container, ownerDocument(this).body);
            this._portalContainerNode.appendChild(this._overlayTarget);
        }

    },