Skip to content

Commit

Permalink
Fix unintended tool switch when typing
Browse files Browse the repository at this point in the history
  • Loading branch information
SunnyHuangCodebase authored and Sinetheta committed Jun 15, 2024
1 parent 76e4bda commit 1a8990b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frontend/src/app/module-blueprint/common/tools/select-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1a8990b

Please sign in to comment.