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 @@ -318,7 +318,7 @@ export default defineComponent({
318318
319319 // if ctrl+click / cmd+click (MacOS uses the meta key) or middle mouse button (button & 4), open in new tab
320320 // also if there is no default action use this as a fallback
321- const metaKeyPressed = event . ctrlKey || event . metaKey || Boolean ( event . button & 4 )
321+ const metaKeyPressed = event . ctrlKey || event . metaKey || event . button === 1
322322 if ( metaKeyPressed || ! this . defaultFileAction ) {
323323 // If no download permission, then we can not allow to download (direct link) the files
324324 if ( isPublicShare ( ) && ! isDownloadable ( this . source ) ) {
@@ -330,7 +330,9 @@ export default defineComponent({
330330 : generateUrl ( '/f/{fileId}' , { fileId : this . fileid } )
331331 event . preventDefault ( )
332332 event . stopPropagation ( )
333- window . open ( url , metaKeyPressed ? '_self' : undefined )
333+
334+ // Open the file in a new tab if the meta key or the middle mouse button is clicked
335+ window . open ( url , metaKeyPressed ? '_blank' : '_self' )
334336 return
335337 }
336338
You can’t perform that action at this time.
0 commit comments