How to use the @mapbox/mr-ui/utils/get-window function in @mapbox/mr-ui

To help you get started, we’ve selected a few @mapbox/mr-ui 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 mapbox / dr-ui / src / components / search / search-modal.js View on Github external
componentWillUnmount() {
    if (typeof window === 'undefined') return;
    getWindow().clearTimeout(this.scrollTimeout);
  }
github mapbox / dr-ui / src / components / search / search-modal.js View on Github external
componentDidMount() {
    if (!this.dialogEl || typeof window === 'undefined') return;
    this.scrollTimeout = getWindow().setTimeout(() => {
      const offsetParent = this.dialogEl.offsetParent;
      if (offsetParent.tagName === 'BODY' || offsetParent.tagName === 'HTML') {
        return;
      }
      offsetParent.scrollTop = 0;
    }, 0);
  }

@mapbox/mr-ui

UI components for Mapbox projects

BSD-2-Clause
Latest version published 13 days ago

Package Health Score

73 / 100
Full package analysis