diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 06:09:05 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 06:09:05 +0000 |
commit | 8c9dc985b90c353b33cb829caf51f8320171bc15 (patch) | |
tree | 9a68886dbea1aefabddb46bbd3faf961eab22ae6 /app/assets/javascripts/lib | |
parent | 500626a5c953ad81cfc3ed74bf0148c075617e58 (diff) | |
download | gitlab-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.js | 5 |
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; }; |