Sfoglia il codice sorgente

Fixed issue with empty selection

Gildas 7 anni fa
parent
commit
8273183325
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      extension/ui/content/content-ui.js

+ 3 - 1
extension/ui/content/content-ui.js

@@ -126,7 +126,9 @@ this.singlefile.ui = this.singlefile.ui || (() => {
 				while (!finished) {
 					if (rangeSelectionFound || treeWalker.currentNode == range.startContainer || treeWalker.currentNode == range.endContainer) {
 						rangeSelectionFound = true;
-						selectionFound = true;
+						if (range.startOffset != range.endOffset) {
+							selectionFound = true;
+						}
 						markSelectedNode(treeWalker.currentNode);
 					}
 					if (treeWalker.currentNode == range.startContainer) {