How to use the @instructure/ui-dom-utils.findDOMNode function in @instructure/ui-dom-utils

To help you get started, we’ve selected a few @instructure/ui-dom-utils 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 instructure / instructure-ui / packages / ui-position / src / Position / index.js View on Github external
toggleLocatorAttributes (set) {
    // We have to find the actual DOM nodes and append the attributes
    // directly, as we can't be sure when safe cloning the child that
    // it will accept the data attribute as a prop
    this.toggleLocatorAttribute(
      findDOMNode(this._content),
      Position.contentLocatorAttribute,
      set
    )

    this.toggleLocatorAttribute(
      findDOMNode(this._target),
      Position.targetLocatorAttribute,
      set
    )
  }
github instructure / instructure-ui / packages / ui-menu / src / Menu / MenuItem / index.js View on Github external
handleKeyUp = e => {
    const spaceKey = e.keyCode === keycode.codes.space
    const enterKey = e.keyCode === keycode.codes.enter

    if (spaceKey || enterKey) {
      e.preventDefault()
      e.stopPropagation()

      if (spaceKey) {
        findDOMNode(this._node).click() // eslint-disable-line react/no-find-dom-node
      }
    }
  }
github instructure / instructure-ui / packages / ui-pages / src / Pages / Page / index.js View on Github external
get defaultFocusElement () {
    let { defaultFocusElement } = this.props

    if (typeof defaultFocusElement === 'function') {
      defaultFocusElement = defaultFocusElement()
    }

    if (defaultFocusElement) {
      defaultFocusElement = findDOMNode(defaultFocusElement)
    }

    if (!defaultFocusElement) {
      const tabbable = findTabbable(this._content)
      defaultFocusElement = tabbable && tabbable[0]
    }

    error(
      defaultFocusElement && defaultFocusElement.focus,
      '[Page] A default focusable element is required or focus will be lost.'
    )

    return defaultFocusElement
  }
github instructure / instructure-ui / packages / ui-layout / src / calculateElementPosition.js View on Github external
this.element = new PositionedElement(element, placement, { top: this.options.offsetY, left: this.options.offsetX })

    this.target = new PositionedElement(
      target || this.container,
      over ? this.element.placement : this.element.mirroredPlacement
    )

    if (constrain === 'window') {
      this.constrainTo(ownerWindow(element))
    } else if (constrain === 'scroll-parent') {
      this.constrainTo(getScrollParents(this.target.node)[0])
    } else if (constrain === 'parent') {
      this.constrainTo(this.container)
    } else if (typeof constrain === 'function') {
      this.constrainTo(findDOMNode(constrain.call(null)))
    } else if (typeof constrain === 'object') {
      this.constrainTo(findDOMNode(constrain))
    }
  }
github instructure / instructure-ui / packages / ui-popover / src / Popover / index.js View on Github external
handleDialogDismiss = (...args) => {
    if (!this.props.shouldReturnFocus && this.props.shouldFocusContentOnTriggerBlur) {
      const trigger = findDOMNode(this._trigger)

      if (trigger && typeof trigger.focus === 'function') {
        trigger.focus()
      }
    }
    this.hide(...args)
  }
github instructure / instructure-ui / packages / ui-layout / src / calculateElementPosition.js View on Github external
this.target = new PositionedElement(
      target || this.container,
      over ? this.element.placement : this.element.mirroredPlacement
    )

    if (constrain === 'window') {
      this.constrainTo(ownerWindow(element))
    } else if (constrain === 'scroll-parent') {
      this.constrainTo(getScrollParents(this.target.node)[0])
    } else if (constrain === 'parent') {
      this.constrainTo(this.container)
    } else if (typeof constrain === 'function') {
      this.constrainTo(findDOMNode(constrain.call(null)))
    } else if (typeof constrain === 'object') {
      this.constrainTo(findDOMNode(constrain))
    }
  }
github instructure / instructure-ui / packages / ui-layout / src / Responsive / index.js View on Github external
addMatchListener (query, updateMatches, match = this.props.match) {
    const matchListener = match === 'element'
      ? addElementQueryMatchListener
      : addMediaQueryMatchListener

    return matchListener(query, findDOMNode(this), updateMatches)
  }
github instructure / instructure-ui / packages / ui-a11y / src / Dialog / index.js View on Github external
get contentElement () {
    let contentElement = findDOMNode(this.props.contentElement)

    if (!contentElement) {
      contentElement = findDOMNode(this._root)
    }

    return contentElement
  }
github instructure / instructure-ui / packages / ui-a11y / src / Dialog / index.js View on Github external
get contentElement () {
    let contentElement = findDOMNode(this.props.contentElement)

    if (!contentElement) {
      contentElement = findDOMNode(this._root)
    }

    return contentElement
  }