Repository: syncthing/syncthing (language: go)

Issue:
gui: Auto select of device ID is broken on Internet Explorer
https://forum.syncthing.net/t/easily-copy-id-to-other-machine/8938/6

<blockquote>
Aha, yeah, Internet Explorer does screw this up.

If I single-click, nothing happens
If I click-and-drag, text gets selected, but is unselected when I release the mouse button.
</blockquote>



Discussion / hints:

Fix patch:
diff --git a/gui/default/assets/css/overrides.css b/gui/default/assets/css/overrides.css
index b5b0de59e8a..7033d8e3690 100644
--- a/gui/default/assets/css/overrides.css
+++ b/gui/default/assets/css/overrides.css
@@ -516,3 +516,7 @@ html[lang="ja"] i,
 html[lang|="ko"] i {
     font-style: normal;
 }
+
+.select-on-click {
+    user-select: all;
+}
diff --git a/gui/default/index.html b/gui/default/index.html
index 08266f50e96..664c8f37fa4 100644
--- a/gui/default/index.html
+++ b/gui/default/index.html
@@ -994,7 +994,6 @@ <h4 class="panel-title">
   <script type="text/javascript" src="syncthing/core/notificationDirective.js"></script>
   <script type="text/javascript" src="syncthing/core/pathIsSubDirDirective.js"></script>
   <script type="text/javascript" src="syncthing/core/popoverDirective.js"></script>
-  <script type="text/javascript" src="syncthing/core/selectOnClickDirective.js"></script>
   <script type="text/javascript" src="syncthing/core/syncthingController.js"></script>
   <script type="text/javascript" src="syncthing/core/tooltipDirective.js"></script>
   <script type="text/javascript" src="syncthing/core/uncamelFilter.js"></script>
diff --git a/gui/default/syncthing/core/selectOnClickDirective.js b/gui/default/syncthing/core/selectOnClickDirective.js
deleted file mode 100644
index a3802b58ba0..00000000000
--- a/gui/default/syncthing/core/selectOnClickDirective.js
+++ /dev/null
@@ -1,14 +0,0 @@
-angular.module('syncthing.core')
-    .directive('selectOnClick', function ($window) {
-        return {
-            link: function (scope, element, attrs) {
-                element.on('click', function () {
-                    var selection = $window.getSelection();
-                    var range = document.createRange();
-                    range.selectNodeContents(element[0]);
-                    selection.removeAllRanges();
-                    selection.addRange(range);
-                });
-            }
-        };
-    });
diff --git a/gui/default/syncthing/device/idqrModalView.html b/gui/default/syncthing/device/idqrModalView.html
index 9587b04b493..24f8da0e701 100644
--- a/gui/default/syncthing/device/idqrModalView.html
+++ b/gui/default/syncthing/device/idqrModalView.html
@@ -1,6 +1,6 @@
 <modal id="idqr" status="info" icon="fas fa-qrcode" heading="{{'Device Identification' | translate}} - {{deviceName(currentDevice)}}" large="yes" closeable="yes">
   <div class="modal-body">
-    <div class="well well-sm text-monospace text-center" select-on-click>{{currentDevice.deviceID}}</div>
+    <div class="well well-sm text-monospace text-center select-on-click">{{currentDevice.deviceID}}</div>
     <img ng-if="currentDevice.deviceID" class="center-block img-thumbnail" ng-src="qr/?text={{currentDevice.deviceID}}" alt="qr code" />
   </div>
   <div class="modal-footer">


Test patch: