Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: useControllableValue behavior with chinese input method #858

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

awmleer
Copy link
Collaborator

@awmleer awmleer commented Feb 4, 2021

Fix #856

@awmleer awmleer self-assigned this Feb 4, 2021
@Dolov
Copy link
Contributor

Dolov commented Feb 4, 2021

Fix #856

我的输入法终于可以不用背锅了~~

@Dolov
Copy link
Contributor

Dolov commented Feb 4, 2021

Fix #856

然后就是想知道 useUpdateEffect 里面的 setState 为什么不放在 handleSetState 方法里面?现在的这种写法会多 render 一次,是有什么特殊的原因么 @awmleer

@awmleer
Copy link
Collaborator Author

awmleer commented Feb 4, 2021

@Dolov 外部导致 props.value 变化的时候,要同步到内部的 state 中呀……

@Dolov
Copy link
Contributor

Dolov commented Feb 4, 2021

@Dolov 外部导致 props.value 变化的时候,要同步到内部的 state 中呀……
那多触发的一次 render 有好的解决办法么 @awmleer

@awmleer
Copy link
Collaborator Author

awmleer commented Feb 4, 2021

@Dolov 应该是有办法的解决的,但是需要的改动比较大,暂时先不搞了

@awmleer
Copy link
Collaborator Author

awmleer commented Feb 4, 2021

@Dolov 这样不行的,在受控模式和非受控模式来回切换的时候会有bug

@Dolov
Copy link
Contributor

Dolov commented Feb 4, 2021

@Dolov 这样不行的,在受控模式和非受控模式来回切换的时候会有bug

https://stackblitz.com/edit/react-ts-xvrh3s?file=components/Demo1.tsx
@awmleer 老哥 ,你说的切换是这个样子的么 ~~

@brickspert brickspert merged commit 2db1b31 into master Feb 5, 2021
@brickspert brickspert deleted the fix/use-controllable-value-chineses branch February 5, 2021 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

input 使用 useControllableValue 无法输入中文
3 participants