diff --git a/core/modules/outside_in/js/outside_in.js b/core/modules/outside_in/js/outside_in.js
index caeef8d..ecd8bdd 100644
--- a/core/modules/outside_in/js/outside_in.js
+++ b/core/modules/outside_in/js/outside_in.js
@@ -10,8 +10,8 @@
   $('.outside-in-editable')
     // Bind an event listener to the .outside-in-editable div
     // This listen for click events and stops default actions of those elements.
-    .on('click', '.js-outside-in-edit-mode', function (e) {
-      if (localStorage.getItem('Drupal.contextualToolbar.isViewing') === 'false') {
+    .on('touchstart click', '.js-outside-in-edit-mode', function (e) {
+      if (isActiveMode()) {
         e.preventDefault();
       }
     })
@@ -19,11 +19,11 @@
     // When a click occurs try and find the outside-in edit link
     // and click it.
     .not('div.contextual a, div.contextual button')
-    .on('click', function (e) {
+    .on('touchstart click', function (e) {
       if ($(e.target.offsetParent).hasClass('contextual')) {
         return;
       }
-      if (!localStorage.getItem('Drupal.contextualToolbar.isViewing')) {
+      if (!isActiveMode()) {
         return;
       }
       var editLink = $(e.target).find('a[data-dialog-renderer="offcanvas"]')[0];
@@ -120,12 +120,12 @@
    */
   Drupal.behaviors.toggleActiveMode = {
     attach: function () {
-      $('.contextual-toolbar-tab.toolbar-tab button').on('click', function () {
+      $('.contextual-toolbar-tab.toolbar-tab button').on('touchstart click', function () {
         setToggleActiveMode();
       });
 
       var search = Drupal.ajax.WRAPPER_FORMAT + '=drupal_dialog';
-      var replace =  Drupal.ajax.WRAPPER_FORMAT + '=drupal_dialog_offcanvas';
+      var replace = Drupal.ajax.WRAPPER_FORMAT + '=drupal_dialog_offcanvas';
       // Loop through all Ajax links and change the format to offcanvas when
       // needed.
       Drupal.ajax.instances
@@ -142,7 +142,7 @@
         .forEach(function (instance) {
           // @todo Move logic for data-dialog-renderer attribute into ajax.js
           //   https://www.drupal.org/node/2784443
-            instance.options.url = instance.options.url.replace(search, replace);
+          instance.options.url = instance.options.url.replace(search, replace);
         });
     }
   };
