From 3a87f8bc31a9d2e31f7e553518a26c0ce7e52ebb Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 3 Sep 2024 20:57:30 +0300 Subject: [PATCH] client: Fix F1 shortcut in mind map (fixes #387) --- src/public/app/widgets/type_widgets/mind_map.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/public/app/widgets/type_widgets/mind_map.js b/src/public/app/widgets/type_widgets/mind_map.js index e0b43f79a..54aa54537 100644 --- a/src/public/app/widgets/type_widgets/mind_map.js +++ b/src/public/app/widgets/type_widgets/mind_map.js @@ -26,6 +26,15 @@ export default class MindMapWidget extends TypeWidget { doRender() { this.$widget = $(TPL); this.$content = this.$widget.find(".mind-map-container"); + this.$content.on("keydown", (e) => { + /* + * Some global shortcuts interfere with the default shortcuts of the mind map, + * as defined here: https://mind-elixir.com/docs/guides/shortcuts + */ + if (e.key === "F1") { + e.stopPropagation(); + } + }); super.doRender(); }