From c1d5c21d2af36bfe23bf8d67f39ea914584db7e8 Mon Sep 17 00:00:00 2001 From: Yash Joshi Date: Thu, 5 Jan 2023 08:52:18 +0530 Subject: [PATCH] fix: prevent redirecting to link when deleting file (#1047) * Bump tinymce from 5.10.4 to 5.10.7 Bumps [tinymce](https://github.com/tinymce/tinymce/tree/HEAD/modules/tinymce) from 5.10.4 to 5.10.7. - [Release notes](https://github.com/tinymce/tinymce/releases) - [Changelog](https://github.com/tinymce/tinymce/blob/5.10.7/modules/tinymce/CHANGELOG.md) - [Commits](https://github.com/tinymce/tinymce/commits/5.10.7/modules/tinymce) --- updated-dependencies: - dependency-name: tinymce dependency-type: direct:production ... Signed-off-by: dependabot[bot] * fix: prevent redirecting to link when deleting file Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Shams Co-authored-by: Han Tuerker --- src/components/fields/File/EditorCell.tsx | 6 ++++-- yarn.lock | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/fields/File/EditorCell.tsx b/src/components/fields/File/EditorCell.tsx index 247c99fa..a520c594 100644 --- a/src/components/fields/File/EditorCell.tsx +++ b/src/components/fields/File/EditorCell.tsx @@ -88,14 +88,16 @@ export default function File_({ onDelete={ disabled ? undefined - : () => + : (e) => { + e.preventDefault(); confirm({ handleConfirm: () => handleDelete(file), title: "Delete file?", body: "This file cannot be recovered after", confirm: "Delete", confirmColor: "error", - }) + }); + } } tabIndex={tabIndex} style={{ width: "100%", cursor: "pointer" }} diff --git a/yarn.lock b/yarn.lock index 003c37e7..d669d494 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12043,9 +12043,9 @@ tiny-invariant@^1.0.6: integrity sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw== tinymce@^5, tinymce@^5.5.1: - version "5.10.6" - resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-5.10.6.tgz#ea03927e9d20c035619dfd32ec4fd471c55e32c5" - integrity sha512-bnF2LUoycDsoZZLQBNHbOijrmoJuEeR1rQdqgo4s77BedufpOVnDh00OZKbseHeTMCxhVH05wvOqxLsi6vpeZw== + version "5.10.7" + resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-5.10.7.tgz#d89d446f1962f2a1df6b2b70018ce475ec7ffb80" + integrity sha512-9UUjaO0R7FxcFo0oxnd1lMs7H+D0Eh+dDVo5hKbVe1a+VB0nit97vOqlinj+YwgoBDt6/DSCUoWqAYlLI8BLYA== tmp@^0.2.1: version "0.2.1"