File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
apps/files/src/components Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -356,7 +356,7 @@ export default defineComponent({
356356
357357 // if ctrl+click / cmd+click (MacOS uses the meta key) or middle mouse button (button & 4), open in new tab
358358 // also if there is no default action use this as a fallback
359- const metaKeyPressed = event . ctrlKey || event . metaKey || Boolean ( event . button & 4 )
359+ const metaKeyPressed = event . ctrlKey || event . metaKey || event . button === 1
360360 if ( metaKeyPressed || ! this . defaultFileAction ) {
361361 // If no download permission, then we can not allow to download (direct link) the files
362362 if ( isPublicShare ( ) && ! isDownloadable ( this . source ) ) {
@@ -368,7 +368,9 @@ export default defineComponent({
368368 : generateUrl ( '/f/{fileId}' , { fileId : this . fileid } )
369369 event . preventDefault ( )
370370 event . stopPropagation ( )
371- window . open ( url , metaKeyPressed ? '_self' : undefined )
371+
372+ // Open the file in a new tab if the meta key or the middle mouse button is clicked
373+ window . open ( url , metaKeyPressed ? '_blank' : '_self' )
372374 return
373375 }
374376
You can’t perform that action at this time.
0 commit comments