From f53f5735e18cbd93e2b0588b38e741ac444f4b46 Mon Sep 17 00:00:00 2001 From: TDaglis Date: Tue, 3 Nov 2015 12:00:28 +0200 Subject: [PATCH] added selection.type fallback check for browsers that might not support Selection.isCollapsed property --- src/xterm.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xterm.js b/src/xterm.js index e0264d64..42c8b81c 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -584,8 +584,10 @@ this.startBlink(); on(this.element, 'mouseup', function() { - var selection = document.getSelection(); - if (selection.isCollapsed) { + var selection = document.getSelection(), + collapsed = selection.isCollapsed, + isRange = typeof collapsed == 'boolean' ? !collapsed : selection.type == 'Range'; + if (!isRange) { self.focus(); } });