mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-06-05 15:12:04 +01:00
Update QueryCopilotPromptbar.tsx
This commit is contained in:
parent
8599f1d98c
commit
f6ebb20ff1
@ -325,18 +325,15 @@ export const QueryCopilotPromptbar: React.FC<QueryCopilotPromptProps> = ({
|
|||||||
|
|
||||||
const handlekeydown: React.KeyboardEventHandler = (e) => {
|
const handlekeydown: React.KeyboardEventHandler = (e) => {
|
||||||
const { key } = e;
|
const { key } = e;
|
||||||
let nexIndexCount = 0;
|
const nexIndexCount = 0;
|
||||||
if (key === "ArrowDown") {
|
if (key === "ArrowDown") {
|
||||||
nexIndexCount = (focusedindex + 1) % suggestionsnhistory.length;
|
nexIndexCount = (focusedindex + 1) % suggestionsnhistory.length;
|
||||||
console.log(nexIndexCount);
|
|
||||||
}
|
}
|
||||||
if (key === "ArrowUp") {
|
if (key === "ArrowUp") {
|
||||||
nexIndexCount = (focusedindex + suggestionsnhistory.length - 1) % suggestionsnhistory.length;
|
nexIndexCount = (focusedindex + suggestionsnhistory.length - 1) % suggestionsnhistory.length;
|
||||||
console.log(nexIndexCount);
|
|
||||||
}
|
}
|
||||||
if (key === "Enter") {
|
if (key === "Enter") {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.log(focusedindex);
|
|
||||||
handleSelection(focusedindex);
|
handleSelection(focusedindex);
|
||||||
}
|
}
|
||||||
setFocusedindex(nexIndexCount);
|
setFocusedindex(nexIndexCount);
|
||||||
@ -358,7 +355,6 @@ export const QueryCopilotPromptbar: React.FC<QueryCopilotPromptProps> = ({
|
|||||||
const handlepromptset = (prompttext: string) => {
|
const handlepromptset = (prompttext: string) => {
|
||||||
inputEdited.current = true;
|
inputEdited.current = true;
|
||||||
setUserPrompt(prompttext);
|
setUserPrompt(prompttext);
|
||||||
console.log("prompt", userPrompt);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user