forked from github/plane
[WEB-] chore: trigger command k from input fields and editors (#4362)
This commit is contained in:
parent
13e6a67321
commit
cc4bb385fe
@ -200,6 +200,11 @@ export const CommandPalette: FC = observer(() => {
|
|||||||
|
|
||||||
const keyPressed = key.toLowerCase();
|
const keyPressed = key.toLowerCase();
|
||||||
const cmdClicked = ctrlKey || metaKey;
|
const cmdClicked = ctrlKey || metaKey;
|
||||||
|
|
||||||
|
if (cmdClicked && keyPressed === "k" && !isAnyModalOpen) {
|
||||||
|
e.preventDefault();
|
||||||
|
toggleCommandPaletteModal(true);
|
||||||
|
}
|
||||||
// if on input, textarea or editor, don't do anything
|
// if on input, textarea or editor, don't do anything
|
||||||
if (
|
if (
|
||||||
e.target instanceof HTMLTextAreaElement ||
|
e.target instanceof HTMLTextAreaElement ||
|
||||||
@ -209,10 +214,7 @@ export const CommandPalette: FC = observer(() => {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (cmdClicked) {
|
if (cmdClicked) {
|
||||||
if (keyPressed === "k") {
|
if (keyPressed === "c" && altKey) {
|
||||||
e.preventDefault();
|
|
||||||
toggleCommandPaletteModal(true);
|
|
||||||
} else if (keyPressed === "c" && altKey) {
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
copyIssueUrlToClipboard();
|
copyIssueUrlToClipboard();
|
||||||
} else if (keyPressed === "b") {
|
} else if (keyPressed === "b") {
|
||||||
|
Loading…
Reference in New Issue
Block a user