fix another source of the selection/clicking bug

This commit is contained in:
wareya committed 2020-02-27 10:12:32 -05:00
1 parent 3af8a638ca
commit 2d95541126
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "nazeka",
"version": "0.4.6",
"version": "0.4.7",
"author": "Wareya",
"homepage_url": "https://github.com/wareya/nazeka",
"description": "A rikai replacement.",
+3 -1
View File
@@ -1800,8 +1800,10 @@ function grab_more_text(textNode, selection_range, direction = 1)
function grab_text(textNode, offset, elemental)
{
let selection_range = window.getSelection();
if(selection_range)
if(selection_range && selection_range.rangeCount > 0)
selection_range = selection_range.getRangeAt(0);
else
selection_range = undefined;
if(selection_filter_enabled(selection_range) && selection_rejects_node(selection_range, textNode, offset))
selection_range = undefined;