diff --git a/src/core/components/file/core-file.html b/src/core/components/file/core-file.html
index e58497f65..7081fa1e1 100644
--- a/src/core/components/file/core-file.html
+++ b/src/core/components/file/core-file.html
@@ -12,7 +12,7 @@
[canTrustDownload]="!alwaysDownload" (action)="download()" size="small">
-
diff --git a/src/core/components/file/file.ts b/src/core/components/file/file.ts
index f33a1ee4c..a2b6b183d 100644
--- a/src/core/components/file/file.ts
+++ b/src/core/components/file/file.ts
@@ -144,10 +144,14 @@ export class CoreFileComponent implements OnInit, OnDestroy {
/**
* Convenience function to open a file, downloading it if needed.
*
+ * @param ev Click event (if any).
* @param isOpenButton Whether the open button was clicked.
* @return Promise resolved when file is opened.
*/
- openFile(isOpenButton = false): Promise {
+ openFile(ev?: Event, isOpenButton = false): Promise {
+ ev?.preventDefault();
+ ev?.stopPropagation();
+
const options: CoreUtilsOpenFileOptions = {};
if (isOpenButton) {
// Use the non-default method.