submit on ctrl-enter
parent
16ad81f403
commit
6b271a41c1
|
@ -263,6 +263,8 @@ export default function MessageInput(props: MessageInputProps) {
|
||||||
const hotkeyHandler = useMemo(() => {
|
const hotkeyHandler = useMemo(() => {
|
||||||
const keys = [
|
const keys = [
|
||||||
['Escape', blur, { preventDefault: true }],
|
['Escape', blur, { preventDefault: true }],
|
||||||
|
['ctrl+Enter', onSubmit, { preventDefault: true }],
|
||||||
|
|
||||||
];
|
];
|
||||||
if (submitOnEnter) {
|
if (submitOnEnter) {
|
||||||
keys.unshift(['Enter', onSubmit, { preventDefault: true }]);
|
keys.unshift(['Enter', onSubmit, { preventDefault: true }]);
|
||||||
|
|
Loading…
Reference in New Issue