ahooks+3.5.0.patch 532 B

12345678910111213
  1. diff --git a/node_modules/ahooks/es/useTextSelection/index.js b/node_modules/ahooks/es/useTextSelection/index.js
  2. index 8ffa296..6f568fb 100644
  3. --- a/node_modules/ahooks/es/useTextSelection/index.js
  4. +++ b/node_modules/ahooks/es/useTextSelection/index.js
  5. @@ -126,7 +126,7 @@ function useTextSelection(target) {
  6. var selObj = window.getSelection();
  7. if (!selObj) return;
  8. - selObj.removeAllRanges();
  9. + selObj.toString() && selObj.removeAllRanges();
  10. };
  11. el.addEventListener('mouseup', mouseupHandler);