mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
feat: disable click-scroll when document has selection
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user