How to use the @instructure/ui-utils/lib/dom/addEventListener function in @instructure/ui-utils

To help you get started, we’ve selected a few @instructure/ui-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-core / src / components / RangeInput / index.js View on Github external
componentDidMount () {
    if (!this._input) {
      return
    }
    // https://connect.microsoft.com/IE/Feedback/Details/856998
    this.inputListener = addEventListener(this._input, 'input', this.handleChange)
    this.changeListener = addEventListener(this._input, 'change', this.handleChange)
  }
github instructure / instructure-ui / packages / ui-core / src / components / RangeInput / index.js View on Github external
componentDidMount () {
    if (!this._input) {
      return
    }
    // https://connect.microsoft.com/IE/Feedback/Details/856998
    this.inputListener = addEventListener(this._input, 'input', this.handleChange)
    this.changeListener = addEventListener(this._input, 'change', this.handleChange)
  }
github instructure / instructure-ui / packages / ui-a11y / src / utils / focusManager.js View on Github external
setupScopedFocus (el, liveRegion) {
    if (this.contextElement) {
      warning(
        false,
        `
        Focus is already scoped to ${this.contextElement}.
        `
      )
      return
    }
    this.contextElement = findDOMNode(el)

    this.listeners.push(addEventListener(ownerWindow(this.contextElement), 'blur', this.handleBlur, false))
    this.listeners.push(addEventListener(ownerDocument(this.contextElement), 'focus', this.handleFocus, true))

    this.screenReaderFocusRegion.isolateRegion(this.contextElement, liveRegion)
  }
github instructure / instructure-ui / packages / ui-a11y / src / utils / focusManager.js View on Github external
setupScopedFocus (el, liveRegion) {
    if (this.contextElement) {
      warning(
        false,
        `
        Focus is already scoped to ${this.contextElement}.
        `
      )
      return
    }
    this.contextElement = findDOMNode(el)

    this.listeners.push(addEventListener(ownerWindow(this.contextElement), 'blur', this.handleBlur, false))
    this.listeners.push(addEventListener(ownerDocument(this.contextElement), 'focus', this.handleFocus, true))

    this.screenReaderFocusRegion.isolateRegion(this.contextElement, liveRegion)
  }
github instructure / instructure-ui / packages / ui-core / src / components / TextArea / index.js View on Github external
autoGrow () {
    if (this.props.autoGrow) {
      if (!this._debounced) {
        this._debounced = debounce(this.grow, 200, {leading: false, trailing: true})
      }

      if (!this._listener) {
        this._listener = addEventListener(window, 'resize', this._debounced)
      }

      this._request = requestAnimationFrame(this._debounced)
    }
  }