From 1a8990bef2b244fcb2b42a38b621735c96b2ff33 Mon Sep 17 00:00:00 2001 From: Sunny Huang <106368104+SunnyHuangCodebase@users.noreply.github.com> Date: Fri, 8 Mar 2024 21:43:29 -0500 Subject: [PATCH] Fix unintended tool switch when typing --- .../src/app/module-blueprint/common/tools/select-tool.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/app/module-blueprint/common/tools/select-tool.ts b/frontend/src/app/module-blueprint/common/tools/select-tool.ts index 1f53e73f..b63b478b 100644 --- a/frontend/src/app/module-blueprint/common/tools/select-tool.ts +++ b/frontend/src/app/module-blueprint/common/tools/select-tool.ts @@ -366,6 +366,13 @@ export class SelectTool implements ITool { this.sameItemCollections[itemGroupToDestroyIndex] ); } else if (keyCode == "b") { + // ignore keypress when a textbox is active + let textboxElements = ["INPUT", "TEXTAREA"]; + let activeElement = document.activeElement.tagName; + if ( textboxElements.includes(activeElement)) { + return; + } + // find the currently selected item let newItem = null; let itemGroupToDestroyIndex = this.currentMultipleSelectionIndex;