feat: disable click-scroll when document has selection

This commit is contained in:
purocean
2022-12-02 19:37:31 +08:00
parent 05cfe0681d
commit d47269672f
+4
View File
@@ -81,6 +81,10 @@ export default {
let clickTimer: number | null = null
ctx.registerHook('VIEW_ELEMENT_CLICK', async ({ e }) => {
if ((e.target as HTMLElement).ownerDocument?.defaultView?.getSelection()?.toString()?.length) {
return
}
if (clickTimer) {
clearTimeout(clickTimer)
clickTimer = null