Update Search.vue

This commit is contained in:
heroboy 2021-09-07 17:32:24 +08:00 committed by GitHub
parent a4d3c06119
commit c43a24a3c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -408,12 +408,16 @@ export default {
this.isShowListAddMultiple = false this.isShowListAddMultiple = false
}, },
handleContextMenu(event) { handleContextMenu(event) {
if (!event.target.classList.contains('select')) return const selection = window.getSelection();
if (!event.target.classList.contains("select") ||
!selection.toString()) {
return;
}
event.stopImmediatePropagation() event.stopImmediatePropagation()
let classList = this.$refs.dom_scrollContent.classList let classList = this.$refs.dom_scrollContent.classList
classList.add(this.$style.copying) classList.add(this.$style.copying)
window.requestAnimationFrame(() => { window.requestAnimationFrame(() => {
let str = window.getSelection().toString() let str = selection.toString()
classList.remove(this.$style.copying) classList.remove(this.$style.copying)
str = str.trim() str = str.trim()
if (!str.length) return if (!str.length) return