How to use the @react-md/utils.addTouchEvent function in @react-md/utils

To help you get started, we’ve selected a few @react-md/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 mlaursen / react-md / packages / listeners / src / touchKeyboardFix.ts View on Github external
function handleTouchStart() {
  if (!focusAdded) {
    window.addEventListener("focus", handleFocus, true);
    focusAdded = true;
  }

  if (!touchEndAdded) {
    addTouchEvent(window, "end", handleTouchEnd, true);
    touchEndAdded = true;
  }
}
github mlaursen / react-md / packages / tooltip / src / MagicTooltipProvider.tsx View on Github external
public componentDidMount() {
    window.addEventListener("blur", this.handleBlur, true);
    window.addEventListener("focus", this.handleFocus, true);
    window.addEventListener("keydown", this.handleKeyDown, true);
    addTouchEvent(window, "start", this.handleTouchStart, true);
  }
github mlaursen / react-md / packages / listeners / src / touchKeyboardFix.ts View on Github external
export function startListening() {
  listeners += 1;
  if (!touchStartAdded) {
    addTouchEvent(window, "start", handleTouchStart);
    touchStartAdded = true;
  }
}
github mlaursen / react-md / packages / listeners / src / ResizeListener.tsx View on Github external
private updateTouch = () => {
    if (!this.props.disableTouchFixes) {
      addTouchEvent(window, "move", this.handleTouchMove);
    } else {
      removeTouchEvent(window, "move", this.handleTouchMove);
    }
  };
github mlaursen / react-md / packages / tooltip / src / MagicTooltipProvider.tsx View on Github external
private handleTouchStart = (event: TouchEvent) => {
    this.touched = true;
    addTouchEvent(window, "end", this.handleTouchEnd, true);
  };