Skip to content

Commit

Permalink
fix(contextmenu):prevent contextmenu default events
Browse files Browse the repository at this point in the history
  • Loading branch information
ni00 authored and ysfscream committed Jun 27, 2023
1 parent 4894a40 commit e66df06
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/SubscriptionsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
background: `${sub.color}10`,
}"
@click="handleClickTopic(sub, index)"
@contextmenu="handleContextMenu(sub, $event)"
@contextmenu.prevent="handleContextMenu(sub, $event)"
>
<div
:style="{
Expand Down
4 changes: 2 additions & 2 deletions src/views/connections/ConnectionsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
v-else-if="!data.isCollection"
class="connection-item"
@click="handleSelectConnection(data)"
@contextmenu="handleContextMenu(data, $event)"
@contextmenu.prevent="handleContextMenu(data, $event)"
>
<div class="item-left">
<div
Expand Down Expand Up @@ -96,7 +96,7 @@
v-else
class="custom-tree-node-collection"
@click="handleSelectCollection(data)"
@contextmenu="handleCollectionContextMenu($event, data)"
@contextmenu.prevent="handleCollectionContextMenu($event, data)"
>
<el-tooltip
:effect="theme !== 'light' ? 'light' : 'dark'"
Expand Down
8 changes: 1 addition & 7 deletions web/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
import { Component, Vue } from 'vue-property-decorator'
@Component
export default class App extends Vue {
private created() {
window.addEventListener('contextmenu', (e) => {
e.preventDefault()
})
}
}
export default class App extends Vue {}
</script>

<style lang="scss">
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/SubscriptionsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
background: `${sub.color}10`,
}"
@click="handleClickTopic(sub, index)"
@contextmenu="handleContextMenu(sub, $event)"
@contextmenu.prevent="handleContextMenu(sub, $event)"
>
<div
:style="{
Expand Down

0 comments on commit e66df06

Please sign in to comment.