Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-] chore: trigger command k from input fields and editors (#4362)

Aaryan Khandelwalcc4bb385fe2f
diff --git a/web/components/command-palette/command-palette.tsx b/web/components/command-palette/command-palette.tsx
index 00de628b7d..37056a96f2 100644
--- a/web/components/command-palette/command-palette.tsx
+++ b/web/components/command-palette/command-palette.tsx
@@ -200,6 +200,11 @@ export const CommandPalette: FC = observer(() => {
const keyPressed = key.toLowerCase();
const cmdClicked = ctrlKey || metaKey;
+
+ if (cmdClicked && keyPressed === "k" && !isAnyModalOpen) {
+ e.preventDefault();
+ toggleCommandPaletteModal(true);
+ }
// if on input, textarea or editor, don't do anything
if (
e.target instanceof HTMLTextAreaElement ||
@@ -209,10 +214,7 @@ export const CommandPalette: FC = observer(() => {
return;
if (cmdClicked) {
- if (keyPressed === "k") {
- e.preventDefault();
- toggleCommandPaletteModal(true);
- } else if (keyPressed === "c" && altKey) {
+ if (keyPressed === "c" && altKey) {
e.preventDefault();
copyIssueUrlToClipboard();
} else if (keyPressed === "b") {