Skip to content

Commit

Permalink
fix(files): Ignore right click for default action
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge authored and backportbot[bot] committed Jun 13, 2024
1 parent c23002b commit c44f160
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/files/src/components/FileEntryMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ export default defineComponent({
/**
* When the source changes, reset the preview
* and fetch the new one.
*
* @param a
* @param b
*/
source(a: Node, b: Node) {
if (a.source !== b.source) {
Expand Down Expand Up @@ -225,6 +228,11 @@ export default defineComponent({
},

execDefaultAction(event) {
// Ignore right click.
if (event.button === 2) {
return
}

// if ctrl+click or middle mouse button, open in new tab
if (event.ctrlKey || event.metaKey || event.button === 1) {
event.preventDefault()
Expand Down

0 comments on commit c44f160

Please sign in to comment.