Preventing the touch default

Back to the mobile homepage.

Test page.

Last major update on 19 February 2014.

On this page I present the results of my research into preventing the default of touch actions.

Theory is clear, and most important browsers follow it. The default of all actions is prevented when you return false (or call preventDefault()) ontouchstart. The touchmove event is trickier: only scroll and pinch-zoom are prevented when you return false on that event. This makes sense, since these two actions are the only ones that actually require the user’s touch to move.

The proxy browsers, Symbian Anna, and Puffin do not support the touch events and are untestable. IE10 supports the pointer events, but does nothing when you return false (or call preventDefault(); or set returnValue). This likely has something to do with the fact that you prevent the defaults in CSS (-ms-touch-action).

Touchstart prevented

Are the following actions prevented if you prevent the default ontouchstart?

iOS Android Chrome Opera BlackBerry Nokia UC Puffin Nintendo Dolphin Tizen One IE 10 Firefox
6 7 2 4 28 31 Mini Mob 12 Mob 18 6 7 10 Xpress MeeGo Anna Belle Mini 8 9 OS And
Tap (click)
Yes Yes See below Yes - Yes Yes - Yes - No - Yes No - Yes No Yes No Yes
Event cascade
Yes Yes See below Yes - Yes Yes - Yes - No - Almost No - Yes No Yes No Yes
  • Android 4 and One fire mouseover and mousemove. They always come before touchstart, so they aren’t cancelled by the touchstart.
  • UC 8 fires the mouseup event, but none of the others.
Double tap
Yes Yes See below Yes - Yes Yes - Yes - No - Yes No Yes No Yes
Scroll
Yes Yes Yes - Yes Yes - Yes - No - No Yes - Yes No Yes Unreliable
  • Firefox 25 sometimes suppresses the scrolling, but not always. Worse on the Pocket than on the HTC. Vertical scrolling more dangerous than horizontal.
Pinch-zoom
Yes No Yes Yes - Yes No Yes - No - No - No Yes - Yes No Yes Unreliable
  • Firefox 25 sometimes suppresses the pinch-zoom, but not always. Worse on the Pocket than on the HTC.
Touchhold
Yes Yes See below Yes - Yes No Yes - Yes - No - Yes - Yes No Yes No Yes

Touchmove prevented

Are the following actions prevented if you prevent the default ontouchmove?

iOS Android Chrome Opera BlackBerry Nokia UC Puffin Nintendo Dolphin Tizen One IE 10 Firefox
6 7 2 4 28 31 Mini Mob 12 Mob 18 6 7 10 Xpress MeeGo Anna Belle Mini 8 9 OS And
Tap (click)
No No No - No No - No - No - No - No No No
Event cascade
No No No - No No - No - No - No - No No No
  • Android 4: Xiaomi and Huawei usually fire an extra mouseout and mousemove event before the regular cascade.
Double tap
No No No - No Yes No - No - No - No No No
Scroll
Yes Yes Yes - Yes Yes No Yes - Yes - No - Yes - Incomplete Yes No No Unreliable
  • The HTC Android 4 does not prevent scrolling.
  • Nintendo allows one single scroll per action, but not more. So the scrolling is not smooth and ends abruptly. This is likely a bug.
  • Firefox 25 sometimes suppresses the scrolling, but not always. Worse on the Pocket than on the HTC. Vertical scrolling more dangerous than horizontal.
Pinch-zoom
Yes No Yes Yes - Incomplete Yes No Yes - Yes - No - Yes - Yes No No Unreliable
  • The HTC Android 4 does not prevent pinch-zooming.
  • Opera 12.10 Android prevents pinch-zooming; 12.00 on Symbian doesn’t.
  • Firefox 25 sometimes suppresses the pinch-zoom, but not always. Worse on the Pocket than on the HTC.
Touchhold
No No No - No No Yes - No - No - No - No No No

Android 4

This table is specifically for Android 4, and mostly about the touchstart event. In general, Android 4 does not prevent the default ontouchmove. Exceptions: scroll and pinch-zoom.

Xiaomi Huawei Note I Sony LG S3 HTC
Tap (click)
touchstart only
No No Yes No Yes Yes Yes
Event cascade
touchstart only
No No Yes No Yes Yes Yes

General note: Android 4 always fires mouseover and mousemove, since they occur before touchstart. This is not counted as a bug.

Double tap
touchstart only
No No Yes No No Yes Yes
Scroll
touchstart and touchmove
Almost Yes Yes Yes Yes Yes Incomplete
  • Xiaomi prevents the default, but nonetheless allows the scrolling of the browser interface.
  • The HTC does not prevent the default ontouchmove.
Pinch-zoom
touchstart and touchmove
Yes Yes Yes Yes Yes Yes Incomplete
  • The HTC does not prevent the default ontouchmove.
Touchhold
touchstart only
Sort of Sort of Yes Sort of Sort of Sort of Yes

Normally, the element is selected (colour change), the phone may vibrate, and a word is selected. All devices except for Note I and HTC select the element, but do not vibrate or select a word.

The Note I doesn’t even select the element. The HTC does, but removes the selection quickly.

Browsers

Mobile browser test array 1.2.5; January 2014

iOS 6
WebKit 536
Default browser on iPhone 4S with iOS 6.1.3
iOS 7
WebKit 537
Default browser on iPad 2 with iOS 7.0.4
Android 2
WebKit 533
Default browser on HTC Legend, Android 2.2
Default browser on Samsung Galaxy Pocket, Android 2.3.6
Android 4
WebKit 534
Default browser on Xiaomi M2, Android 4.1.1
Default browser on Huawei C8813, Android 4.1.1
Default browser on Samsung Galaxy Note I, Android 4.1.2
Default browser on Sony Xperia S, Android 4.1.2
Default browser on LG L5, Android 4.1.2
Default browser on Samsung Galaxy S3, Android 4.1.2
Default browser on HTC One X, Android 4.2.2
Chrome 28
Blink
Default browser on Samsung Galaxy S4, Android 4.3
It will be interesting to see if Samsung’s purported Chrome 18 is really the real Chrome 28.
Chrome 31
Blink
On HTC One X, Android 4.2.2
On Nexus 7, Android 4.4
Opera Mini
Presto
Proxy browser
7.0.5 on iPad 2, iOS 7.0.3
7.1 on BlackBerry 9800 (OS6)
7.1 on Nokia PureView 808, Symbian Belle
7.5 on Samsung Galaxy Note I, Android 4.0.3
Opera Mobile 12
Presto
12.00 on Nokia E7, Symbian Anna
12.10 on Samsung Galaxy Pocket, Android 2.3.6
Opera Mobile 18
Blink (Chromium version not given; likely 30 or 31)
On Sony Xperia S, Android 4.1.2
On Nexus 7, Android 4.3
BlackBerry 6
WebKit 534
Default browser on BB Torch 9800 (OS6)
BlackBerry 7
WebKit 534
Default browser on BB Torch 9810 (OS7)
BlackBerry 10
WebKit 537
Default browser on BlackBerry Z10 (BB OS 10.1)
This device has 1GB of internal memory instead of the customary 2GB, which may matter in performance tests.
Xpress
Gecko 20100401; this version was used for some Firefoxes from 3 to 4.
Proxy browser
3.9 on the Nokia Asha 311, S40.
This browser used to be called Ovi. Nokia developed it because it saw how succesful Opera was on Nokia’s own devices.
MeeGo
WebKit 534
Default browser on Nokia N950, MeeGo Harmattan 1.2
Originally slated as Symbian’s successor, MeeGo was ousted in favour of Windows Phone. Some devices were sold, however, and a Finnish company is trying to re-start MeeGo under the name Sailfish. Also, rumour has it that Nokia is quietly hiring back ex-MeeGo people, so a Nokia-based restart is not entirely impossible.
Anna
WebKit 533
Default browser (7.3) on Nokia E7, Symbian Anna
The next-to-last Symbian build. I don’t think it was the prime Symbian build for long; it was replaced by Belle fairly soon. But it’ll be in some people’s pockets.
Belle
WebKit 535
Default browser (8.3) on Nokia PureView 808, Symbian Belle FP2
The most recent Symbian build.
UC Mini
Gecko; don’t know version number
Proxy browser
8.8 on HTC One X, Android 4.2.2
UC
WebKit 534
UC 8.5.1 on Xiaomi M2 (Android 4.1.1)
UC 9.2.3 on Huawei C8813 (Android 4.1.1)
The largest Chinese browser. This is the full variant, not the proxy. These browsers were pre-installed (next to Android WebKit; don’t ask me why).
Puffin
WebKit 534
2.1 Free Edition on Samsung Galaxy Note, Android 4.0.3
Claims to be Chrome 11
Nintendo
WebKit 536
Nintendo browser 2.0.0 on Wii U 4.0.0
Supposed to be based on NetFront.
Dolphin
WebKit 534
Dolphin 10 with JetPack on Sony Xperia S, Android 4.1.2.
Independent full browser for Android, as long as you install both Dolphin 10 and the Jetpack extension.
QQ One
WebKit 533
4.2.2 on HTC One X, Android 4.2.2
This is the downloadable, international browser TenCent created.
Tizen
WebKit 537
Default browser on Ref.Device-PQ by Samsung; Tizen 2.2
Tizen is an OS jointly being developed by Samsung and Intel. I expect Samsung to start producing devices this year, and it will get a few percent of market share.
IE10
Trident
Default browser on Nokia Lumia 820, Windows Phone 8.0.
Firefox OS
Gecko 18
Geekphone/Telefónica (Peak and/or qcom); Boot2Gecko 1.0.1.0-prerelease
Default browser on ZTE Open, FF OS 1.0.0802
The ZTE Open will get an upgrade to 1.1 pretty soon.
Firefox Android
Gecko 25
25 on Samsung Galaxy Pocket, Android 2.3.6
25 on HTC One X, Android 4.2.2