From 3a9447185f07966b9e2d247782b685377c8b948c Mon Sep 17 00:00:00 2001 From: Philippe Potvin Date: Sun, 21 Aug 2016 05:44:17 -0400 Subject: [PATCH] dblClick test nodeName (#641) --- lib/utils/selection.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/utils/selection.js b/lib/utils/selection.js index b6bfaad3..6ba1a8eb 100644 --- a/lib/utils/selection.js +++ b/lib/utils/selection.js @@ -6,7 +6,12 @@ exports.clear = function (terminal) { // Use selection extend upon dblclick exports.extend = function (terminal) { - terminal.screen_.expandSelection(terminal.document_.getSelection()); + let sel = terminal.document_.getSelection(); + + // Test if focusNode exist and nodeName is #text + if (sel.focusNode && sel.focusNode.nodeName === '#text') { + terminal.screen_.expandSelection(sel); + } }; // Fix a bug in ScrollPort selectAll behavior