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

TextareaItem autoHeight 时,频幕滚动问题 #1858

Closed
LPegasus opened this issue Sep 18, 2017 · 3 comments
Closed

TextareaItem autoHeight 时,频幕滚动问题 #1858

LPegasus opened this issue Sep 18, 2017 · 3 comments
Assignees

Comments

@LPegasus
Copy link

LPegasus commented Sep 18, 2017

Version

1.6.7

Environment

ios 10.3 simulator、android 5.1motorola_XT1085、android 6.0 Samsung s6e

Reproduction link

https://gist.github.com/LPegasus/b5c109b85c56c234c4b946bad2b9c1a6

Steps to reproduce

  • 输入 TextareaItem 填写很多很多文字,使频幕可滚动

  • 触发 TextareaItem 的 componentDidUpdate

  • fill plenty of words into a the first TextareaItem with autoHeight prop till the body scrollbar appears

  • do any action to trigger the first TextareaItem's componentDidUpdate function

What is expected?

频幕稳定在原位置

window should be stable

What is actually happening?

频幕滚动

window scroll to top


TextareaItem componentDidUpdate 中把

textareaDom.style.height = ''; // 字数减少时能自动减小高度
textareaDom.style.height = textareaDom.scrollHeight +  'px';

延迟执行,可以解决此问题。

delay the above two code lines may useful.

@ant-design-bot
Copy link

It will be better to write your issue/comment in English, so more people can understand you.
And this means that more people can help you or benefit from your issue/comment.
See: ant-design/ant-design#4897

@silentcloud silentcloud self-assigned this Sep 18, 2017
@silentcloud
Copy link
Contributor

延迟执行不能解决这个问题,应该是判断当前是不是 focus

lixiaoyang1992 pushed a commit to lixiaoyang1992/ant-design-mobile that referenced this issue Apr 26, 2018
@Lawrence51
Copy link

延迟执行不能解决这个问题,应该是判断当前是不是 focus

这个判断应该是在哪里啊

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

4 participants