You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
447 B

  1. // Package imports.
  2. import detectPassiveEvents from 'detect-passive-events';
  3. // This will either be a passive lister options object (if passive
  4. // events are supported), or `false`.
  5. export const withPassive = detectPassiveEvents.hasSupport ? { passive: true } : false;
  6. // Focuses the root element.
  7. export function focusRoot () {
  8. let e;
  9. if (document && (e = document.querySelector('.ui')) && (e = e.parentElement)) {
  10. e.focus();
  11. }
  12. }