react-dates
Version:
A responsive and accessible date range picker component built with React
12 lines (11 loc) • 377 B
JavaScript
export default function isTouchDevice() {
return (
!!(typeof window !== 'undefined' &&
('ontouchstart' in window ||
(window.DocumentTouch &&
typeof document !== 'undefined' &&
document instanceof window.DocumentTouch))) ||
!!(typeof navigator !== 'undefined' &&
(navigator.maxTouchPoints || navigator.msMaxTouchPoints))
);
}