|
@@ -185,7 +185,12 @@ function ContextPromptItem(props: {
|
|
className={chatStyle["context-content"]}
|
|
className={chatStyle["context-content"]}
|
|
rows={focusingInput ? 5 : 1}
|
|
rows={focusingInput ? 5 : 1}
|
|
onFocus={() => setFocusingInput(true)}
|
|
onFocus={() => setFocusingInput(true)}
|
|
- onBlur={() => setFocusingInput(false)}
|
|
|
|
|
|
+ onBlur={() => {
|
|
|
|
+ setFocusingInput(false);
|
|
|
|
+ // If the selection is not removed when the user loses focus, some
|
|
|
|
+ // extensions like "Translate" will always display a floating bar
|
|
|
|
+ window?.getSelection()?.removeAllRanges();
|
|
|
|
+ }}
|
|
onInput={(e) =>
|
|
onInput={(e) =>
|
|
props.update({
|
|
props.update({
|
|
...props.prompt,
|
|
...props.prompt,
|