File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed
client/src/components/Chat/Input Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -127,13 +127,9 @@ const ChatForm = memo(({ index = 0 }: { index?: number }) => {
127
127
128
128
const { submitMessage, submitPrompt } = useSubmitMessage ( ) ;
129
129
130
- // Detects if the device is a touch-screen by checking if the primary input mechanism is coarse (e.g., a finger).
131
- const isTouchScreen = useMemo ( ( ) => window . matchMedia ?.( '(pointer: coarse)' ) . matches , [ ] ) ;
132
-
133
130
const onSubmit = methods . handleSubmit ( ( data : { text : string } ) => {
134
131
submitMessage ( data ) ;
135
- // On touch-screen devices, blur the text area to dismiss the on-screen keyboard
136
- if ( isTouchScreen ) {
132
+ if ( window . matchMedia ?.( '(pointer: coarse)' ) . matches ) {
137
133
textAreaRef . current ?. blur ( ) ;
138
134
}
139
135
} ) ;
You can’t perform that action at this time.
0 commit comments