mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
chore: switch focus to textarea when custom model change (still need to figure out reg model change)
This commit is contained in:
parent
ff45511011
commit
d052d221dc
3 changed files with 7 additions and 10 deletions
|
|
@ -185,11 +185,11 @@ export default function TextChat({ messages }) {
|
|||
sender,
|
||||
};
|
||||
console.log('User Input:', message);
|
||||
// handleSubmit(submission);
|
||||
dispatch(setSubmission(submission));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
inputRef.current?.focus();
|
||||
if (Object.keys(submission).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ export default function TextWrapper({ text, generateCursor }) {
|
|||
return (
|
||||
<>
|
||||
{result}
|
||||
{(<>{generateCursor()}</>)}
|
||||
{generateCursor()}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,14 +65,13 @@ export default function ModelMenu() {
|
|||
localStorage.setItem('model', JSON.stringify(model));
|
||||
}, [model]);
|
||||
|
||||
const onChange = (value, custom = false) => {
|
||||
const onChange = (value) => {
|
||||
if (!value) {
|
||||
return;
|
||||
} else if (value === model) {
|
||||
return;
|
||||
} else if (value === 'chatgptCustom') {
|
||||
// dispatch(setMessages([]));
|
||||
return;
|
||||
// return;
|
||||
} else if (initial[value]) {
|
||||
dispatch(setModel(value));
|
||||
dispatch(setDisabled(false));
|
||||
|
|
@ -84,9 +83,7 @@ export default function ModelMenu() {
|
|||
dispatch(setCustomGpt({ chatGptLabel, promptPrefix }));
|
||||
dispatch(setModel('chatgptCustom'));
|
||||
dispatch(setCustomModel(value));
|
||||
// if (custom) {
|
||||
// setMenuOpen((prevOpen) => !prevOpen);
|
||||
// }
|
||||
setMenuOpen(false);
|
||||
} else if (!modelMap[value]) {
|
||||
dispatch(setCustomModel(null));
|
||||
}
|
||||
|
|
@ -160,7 +157,7 @@ export default function ModelMenu() {
|
|||
{icon}
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent className="w-56 dark:bg-gray-700">
|
||||
<DropdownMenuContent className="w-56 dark:bg-gray-700" onCloseAutoFocus={(event) => event.preventDefault()}>
|
||||
<DropdownMenuLabel className="dark:text-gray-300">Select a Model</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuRadioGroup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue