import { Component } from "react";
const CLASS_NAME = "no-outline";
class AccessibilityListener extends Component {
  constructor() {
    super(...arguments);
    this.handleTabKeyUp = (e) => {
      if (e.which === 9 && document.body.classList.contains(CLASS_NAME)) {
        document.body.classList.remove(CLASS_NAME);
      }
    };
    this.handleClick = () => {
      if (!document.body.classList.contains(CLASS_NAME)) {
        document.body.classList.add(CLASS_NAME);
      }
    };
    this.render = () => null;
  }
  componentDidMount() {
    document.body.classList.add(CLASS_NAME);
    if (!this.props.isMobile) {
      document.addEventListener("keyup", this.handleTabKeyUp);
      document.addEventListener("click", this.handleClick);
    }
  }
  componentWillUnmount() {
    if (!this.props.isMobile) {
      document.removeEventListener("keyup", this.handleTabKeyUp);
      document.removeEventListener("click", this.handleClick);
    }
  }
}
export {
  AccessibilityListener
};
//# sourceMappingURL=accessibility-listener.js.map
