🔧 fix(useTextArea): Incorrect New Line while Composing Japanese Text (#3103)

This commit is contained in:
Yuichi Oneda 2024-06-21 06:59:31 -07:00 committed by GitHub
parent 54b1095239
commit 3172381bad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -182,7 +182,13 @@ export default function useTextarea({
e.preventDefault();
}
if (e.key === 'Enter' && !enterToSend && !isCtrlEnter && textAreaRef.current) {
if (
e.key === 'Enter' &&
!enterToSend &&
!isCtrlEnter &&
textAreaRef.current &&
!isComposing?.current
) {
e.preventDefault();
insertTextAtCursor(textAreaRef.current, '\n');
forceResize(textAreaRef.current);