is-touch-device icon indicating copy to clipboard operation
is-touch-device copied to clipboard

Rename?

Open lencioni opened this issue 8 years ago • 7 comments

The name is-touch-device or isTouchDevice has a connotation that it is only or primarily a touch device which is not the case. I worry that this will cause people to misuse this or make bad decisions. Perhaps a name more like deviceHasTouch would be better?

lencioni avatar Jun 19 '17 15:06 lencioni

I'm not sure I agree that it has that connotation, nor that a rename wouldn't convey the same issue if somebody was prone to that misassumption.

ljharb avatar Jun 19 '17 15:06 ljharb

Is this image red? red_and_blue_800_x_600 _horizontal

lencioni avatar Jun 19 '17 16:06 lencioni

FWIW I'd make the same assumption. Just the word "device" makes me think "something other than a desktop/laptop"

isTouchSupported touchEnabled ronTouchable touchSupported

gdborton avatar Jun 20 '17 21:06 gdborton

isTouchSupported could work. I'm just not convinced it's that necessary; would someone who was already likely to support touch/mouse combo devices not do so with the current name who would with a new name; and would someone who was already likely not to support touch/mouse combo devices with the current name do so with the new name?

Separately, we've had this name for the helper in our own codebase as well as react-dates for well over a year, and nobody's raised a question about the name before.

ljharb avatar Jun 21 '17 02:06 ljharb

While developing a responsive web app with an interactive (Google) map as the primary UI component, I sought to configure the zoom control based on whether or not the client was a mobile device. If it's a mobile device, rely on pinch-to-zoom. Otherwise, if it's a laptop/desktop, it's desirable to show the zoom slider (or +/- icons) overlaid on the map.

I naively sought to determine whether or not the client was a mobile device. After looking into UA sniffing and other hacks, I came upon Modernizr's ability to detect touch events. Modernizr makes it explicit it is only checking for touch events, as opposed to the type of device, and the user should not assume the device is a mobile device.

I think the distinction between touch/mobile device detection and touch event detection is of particular importance for appropriately handling devices such as laptop/tablet-hybrids with touch support whose primary input may not be touch based.

I think increased explicitness may be helpful to a user who may naively think isTouchDevice implies the device in question is a mobile device or a device primarily receiving touch input.

fvgs avatar Jun 21 '17 07:06 fvgs

I was just about to use this module because I thought it would separate a touch device like phone and tablet from a computer or laptop. I would consider a laptop with touchscreen NOT a touch device.

-> The name is misleading IMO and the readme contains no description at all

MickL avatar Nov 11 '21 13:11 MickL

I literally came into this issue queue to learn more about what this was detecting, and this open issue had the best answer. If not a rename, then a very clear note in the readme feels like a good minimum step. But to clarify, rename seems better, maybe to avoid package name hassle:

var isTouchSupported = require('is-touch-device').isTouchSupported;

EDIT: Thanks for the simple package -- way better than an SO answer :)

patcon avatar Oct 24 '23 18:10 patcon