forked from XiaoMo/ChatGPT-Next-Web
Merge pull request #1946 from cesaryuan/fix-selection
fix: remove selection range when user blured
This commit is contained in:
commit
590bd8e4bb
@ -185,7 +185,12 @@ function ContextPromptItem(props: {
|
||||
className={chatStyle["context-content"]}
|
||||
rows={focusingInput ? 5 : 1}
|
||||
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) =>
|
||||
props.update({
|
||||
...props.prompt,
|
||||
|
Loading…
Reference in New Issue
Block a user