File tree 1 file changed +5
-5
lines changed
web/app/components/base/chat/chat/chat-input-area
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -102,21 +102,21 @@ const ChatInputArea = ({
102
102
setCurrentIndex ( historyRef . current . length )
103
103
handleSend ( )
104
104
}
105
- else if ( e . key === 'ArrowUp' && ! e . shiftKey && ! e . nativeEvent . isComposing ) {
106
- // When the up key is pressed, output the previous element
105
+ else if ( e . key === 'ArrowUp' && ! e . shiftKey && ! e . nativeEvent . isComposing && e . metaKey ) {
106
+ // When the cmd + up key is pressed, output the previous element
107
107
if ( currentIndex > 0 ) {
108
108
setCurrentIndex ( currentIndex - 1 )
109
109
setQuery ( historyRef . current [ currentIndex - 1 ] )
110
110
}
111
111
}
112
- else if ( e . key === 'ArrowDown' && ! e . shiftKey && ! e . nativeEvent . isComposing ) {
113
- // When the down key is pressed, output the next element
112
+ else if ( e . key === 'ArrowDown' && ! e . shiftKey && ! e . nativeEvent . isComposing && e . metaKey ) {
113
+ // When the cmd + down key is pressed, output the next element
114
114
if ( currentIndex < historyRef . current . length - 1 ) {
115
115
setCurrentIndex ( currentIndex + 1 )
116
116
setQuery ( historyRef . current [ currentIndex + 1 ] )
117
117
}
118
118
else if ( currentIndex === historyRef . current . length - 1 ) {
119
- // If it is the last element, clear the input box
119
+ // If it is the last element, clear the input box
120
120
setCurrentIndex ( historyRef . current . length )
121
121
setQuery ( '' )
122
122
}
You can’t perform that action at this time.
0 commit comments