mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 18:19:11 +08:00
fix: revert ref usage in handleFormChange to fix IME input issues (#9672)
Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
This commit is contained in:
parent
b4041759f7
commit
b9afb7bcec
@ -1,3 +1,4 @@
|
|||||||
|
import { useCallback } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useChatWithHistoryContext } from '../context'
|
import { useChatWithHistoryContext } from '../context'
|
||||||
import Input from './form-input'
|
import Input from './form-input'
|
||||||
@ -15,12 +16,12 @@ const Form = () => {
|
|||||||
isMobile,
|
isMobile,
|
||||||
} = useChatWithHistoryContext()
|
} = useChatWithHistoryContext()
|
||||||
|
|
||||||
const handleFormChange = (variable: string, value: any) => {
|
const handleFormChange = useCallback((variable: string, value: any) => {
|
||||||
handleNewConversationInputsChange({
|
handleNewConversationInputsChange({
|
||||||
...newConversationInputsRef.current,
|
...newConversationInputsRef.current,
|
||||||
[variable]: value,
|
[variable]: value,
|
||||||
})
|
})
|
||||||
}
|
}, [newConversationInputsRef, handleNewConversationInputsChange])
|
||||||
|
|
||||||
const renderField = (form: any) => {
|
const renderField = (form: any) => {
|
||||||
const {
|
const {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { useCallback } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useEmbeddedChatbotContext } from '../context'
|
import { useEmbeddedChatbotContext } from '../context'
|
||||||
import Input from './form-input'
|
import Input from './form-input'
|
||||||
@ -15,12 +16,12 @@ const Form = () => {
|
|||||||
isMobile,
|
isMobile,
|
||||||
} = useEmbeddedChatbotContext()
|
} = useEmbeddedChatbotContext()
|
||||||
|
|
||||||
const handleFormChange = (variable: string, value: any) => {
|
const handleFormChange = useCallback((variable: string, value: any) => {
|
||||||
handleNewConversationInputsChange({
|
handleNewConversationInputsChange({
|
||||||
...newConversationInputsRef.current,
|
...newConversationInputsRef.current,
|
||||||
[variable]: value,
|
[variable]: value,
|
||||||
})
|
})
|
||||||
}
|
}, [newConversationInputsRef, handleNewConversationInputsChange])
|
||||||
|
|
||||||
const renderField = (form: any) => {
|
const renderField = (form: any) => {
|
||||||
const {
|
const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user