From 46d957a367995a97bb26bb6e46f9601ef5fc92b1 Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Fri, 9 Apr 2021 11:50:47 -0400 Subject: [PATCH] Fix hotkeys in Ace Editor (#617) - Corrects Cmd + L (selects URL bar) - Corrects Cmd + F (opens find command) Closes #304 --- frontend/components/KolideAce/KolideAce.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/components/KolideAce/KolideAce.jsx b/frontend/components/KolideAce/KolideAce.jsx index 0f093a4822..aa55d56d91 100644 --- a/frontend/components/KolideAce/KolideAce.jsx +++ b/frontend/components/KolideAce/KolideAce.jsx @@ -77,6 +77,11 @@ class KolideAce extends Component { [`${baseClass}__wrapper--error`]: error, }); + const fixHotkeys = (editor) => { + editor.commands.removeCommands(['gotoline', 'find']); + onLoad && onLoad(editor); + }; + return (
{renderLabel()} @@ -90,7 +95,7 @@ class KolideAce extends Component { maxLines={20} name={name} onChange={onChange} - onLoad={onLoad} + onLoad={fixHotkeys} readOnly={readOnly} setOptions={{ enableLinking: true }} showGutter={showGutter}