summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 06:09:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 06:09:05 +0000
commit8c9dc985b90c353b33cb829caf51f8320171bc15 (patch)
tree9a68886dbea1aefabddb46bbd3faf961eab22ae6 /app/assets/javascripts/lib
parent500626a5c953ad81cfc3ed74bf0148c075617e58 (diff)
downloadgitlab-ce-8c9dc985b90c353b33cb829caf51f8320171bc15.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js
index a2591180039..dd5a52fe1ce 100644
--- a/app/assets/javascripts/lib/utils/common_utils.js
+++ b/app/assets/javascripts/lib/utils/common_utils.js
@@ -327,7 +327,10 @@ export const getSelectedFragment = restrictToNode => {
documentFragment.originalNodes.push(range.commonAncestorContainer);
}
}
- if (documentFragment.textContent.length === 0) return null;
+
+ if (documentFragment.textContent.length === 0 && documentFragment.children.length === 0) {
+ return null;
+ }
return documentFragment;
};