aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPatrick H. Lauke <[email protected]>2015-11-15 23:30:11 +0000
committerPatrick H. Lauke <[email protected]>2015-11-16 01:08:20 +0000
commit8ec78197250b5a18cb87ecdb386e3fd5c5a6fba2 (patch)
tree6b17af5447e03ba016260936e0f66c53b6e52b86 /docs
parent01a44bfa938b8108a77831f8157c5181808a7729 (diff)
downloadbootstrap-8ec78197250b5a18cb87ecdb386e3fd5c5a6fba2.tar.xz
bootstrap-8ec78197250b5a18cb87ecdb386e3fd5c5a6fba2.zip
Touch responsiveness optimization
Admittedly wordy info dump on why we use `touch-action:manipulation` refs https://github.com/twbs/bootstrap/pull/18051#issuecomment-156375970
Diffstat (limited to 'docs')
-rw-r--r--docs/content/reboot.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/content/reboot.md b/docs/content/reboot.md
index fc708554e..19549d8a0 100644
--- a/docs/content/reboot.md
+++ b/docs/content/reboot.md
@@ -301,3 +301,17 @@ HTML5 adds [a new global attribute named `[hidden]`](https://developer.mozilla.o
{% endcallout %}
To merely toggle the visibility of an element, meaning its `display` is not modified and the element can still affect the flow of the document, use [the `.invisible` class]({{ site.baseurl }}/components/utilities/#invisible-content) instead.
+
+## Click delay optimization for touch
+
+Traditionally, browsers on touchscreen devices have a delay of approximately 300ms between the end of a "tap" – the moment when a finger/stylus is lifted from screen – and the `click` event being fired. This delay is necessary for these browsers to correctly handle "double-tap to zoom" gestures without prematurely triggering actions or links after the first "tap", but it can make your site feel slightly sluggish and unresponsive.
+
+Most mobile browsers automatically optimize away this 300ms delay for sites that use the `width=device-width` property as part of their [responsive meta tag]({{ site.baseurl }}/getting-started/introduction/#responsive-meta-tag) (as well as for sites that disable zooming, for instance with `user-scalable=no`, though this practice is strongly discouraged for accessibility and usability reasons). The biggest exceptions here are currently iOS Safari (and any other WebView-based browser) – though this is likely to change in iOS 10, see [WebKit bug #150604](https://bugs.webkit.org/show_bug.cgi?id=150604) – and IE11 on Windows Phone 8.1.
+
+On touch-enabled laptop/desktop devices, IE11 and Microsoft Edge are currently the only browsers with "double-tap to zoom" functionality. As the [responsive meta tag]({{ site.baseurl }}/getting-started/introduction/#responsive-meta-tag) is ignored by all desktop browsers, using `width=device-width` will have no effect on the 300ms delay here.
+
+To address this problem in IE11 and Microsoft Edge on desktop, as well as IE11 on Windows Phone 8.1, Bootstrap explicitly uses the [`touch-action:manipulation` CSS property](https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action) on all interactive elements (such as buttons and links). This property essentially disables double-tap functionality on those elements, eliminating the 300ms delay.
+
+In the case of iOS, the currently suggested approach is to use additional scripts such as [FastClick](https://github.com/ftlabs/fastclick) to explicitly work around the delay.
+
+For further details see the compatibility table for [suppressing 300ms delay for touchscreen interactions](http://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay). \ No newline at end of file