diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-03-23 18:54:37 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-03-23 19:01:36 +1100 |
| commit | 7ca13b43410364a4ac3bd109e3215a7c26814b93 (patch) | |
| tree | 6b96fdd6b094b29e6353a884eeb275fb2ad64947 | |
| parent | 0b736a9df79b5ab88e40858e5f94a32d141a76ba (diff) | |
Prevent double-clicks from highlighting text
| -rw-r--r-- | src/App.vue | 1 | ||||
| -rw-r--r-- | src/components/TileTree.vue | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/App.vue b/src/App.vue index 234896d..7d1c7fa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,6 @@ import {defineComponent} from 'vue'; import TileTree from './components/TileTree.vue'; - export default defineComponent({ data(){ return { diff --git a/src/components/TileTree.vue b/src/components/TileTree.vue index f007935..c6f0061 100644 --- a/src/components/TileTree.vue +++ b/src/components/TileTree.vue @@ -176,6 +176,12 @@ export default defineComponent({ this.activeRoot = layoutNode; tryLayout(layoutNode, this.tileAreaPos, this.tileAreaDims, this.layoutOptions, true); }, + // For preventing double-clicks from highlighting text + onMouseDown(evt: Event){ + if (evt.detail == 2){ + evt.preventDefault(); + } + }, }, created(){ tryLayout(this.activeRoot, this.tileAreaPos, this.tileAreaDims, this.layoutOptions, true); @@ -188,7 +194,7 @@ export default defineComponent({ </script> <template> -<div :style="styles"> +<div :style="styles" @mousedown="onMouseDown"> <tile :layoutNode="layoutTree" :headerSz="layoutOptions.headerSz" :tileSpacing="layoutOptions.tileSpacing" :options="componentOptions" @leaf-clicked="onInnerLeafClicked" @header-clicked="onInnerHeaderClicked" |
