packages/mdc-drawer/util.js
// Determine whether the current browser supports passive event listeners, and if so, use them.
Determine whether the current browser supports passive event listeners, and if so, use them.
Determine whether the current browser supports passive event listeners and if so use them .
function applyPassive(globalObj = window, forceRefresh = false) {
  if (supportsPassive_ === undefined || forceRefresh) {
    let isSupported = false;
    try {
      globalObj.document.addEventListener('test', null, {get passive() {
        isSupported = true;
      }});
    } catch (e) { }
    supportsPassive_ = isSupported;
  }
  return supportsPassive_ ? {passive: true} : false;
}
function applyPassive ( globalObj = window , forceRefresh = false ) { if ( supportsPassive_ === undefined || forceRefresh ) { let isSupported = false ; try { globalObj . document . addEventListener ( 'test' , null , { get passive ( ) { isSupported = true ; } } ) ; } catch ( e ) { } supportsPassive_ = isSupported ; } return supportsPassive_ ? { passive : true } : false ; }
Determine whether the current browser supports passive event listeners, and if so, use them.
Determine whether the current browser supports passive event listeners and if so use them .