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

sample中两个EditableText同时出现焦点光标 #33

Closed
TianbinTobin opened this issue Mar 6, 2019 · 4 comments
Closed

sample中两个EditableText同时出现焦点光标 #33

TianbinTobin opened this issue Mar 6, 2019 · 4 comments

Comments

@TianbinTobin
Copy link

image
在模拟器中与真机中运行都有这个问题

@hyjfine
Copy link
Contributor

hyjfine commented Mar 6, 2019

EditableText不提供焦点控制,这里其实用TextField会好些
/// This widget interacts with the [TextInput] service to let the user edit the
/// text it contains. It also provides scrolling, selection, and cursor
/// movement. This widget does not provide any focus management (e.g.,
/// tap-to-focus).

@hyjfine
Copy link
Contributor

hyjfine commented Mar 6, 2019

问题是focusNode引起的,下班开始仔细看了2个小时,最后断点发现EditableText的_handleSelectionChanged在切换焦点时会丢失一个。同样的例子不用fish_redux是ok的。所以应该是fish_redux细节没用对,仔细一看EditableText的FocusNode是每次update都会实例化的,而这个应该是要state传过来才是科学的。

@zjuwjf zjuwjf closed this as completed in e2a34c8 Mar 7, 2019
zjuwjf added a commit that referenced this issue Mar 7, 2019
@TianbinTobin
Copy link
Author

@hyjfine 还是没懂造成这个问题的原因,在不用fish_redux时,两个EditAbleText同样是参数focusNode: FocusNode(),也是每次update都是new 一个新的FocusNode 实例吧?,但是并没有造成同时出现两个光标,但是用fish_redux为什么会造成这个问题呢?

zjuwjf pushed a commit that referenced this issue Mar 7, 2019
* 'master' of https://github.com/alibaba/fish-redux:
  fix #33 NodeFocus case
  Fix spell. 'has not bean used' => 'has not been used'
  fix typo
  fix: 否者 => 否则
@andyxiaoxi
Copy link

我也出现这个问题了,感觉很疑惑

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

No branches or pull requests

3 participants