ng-zorro-antd-mobile的TextareaItem组件autoHeight有Bug

新手上路,请多包涵

问题描述

ng-zorro-antd-mobile的TextareaItem组件autoHeight有Bug

问题出现的环境背景及自己尝试过哪些方法

ng-zorro-antd-mobile的TextareaItem组件autoHeight有Bug:

steps

  1. 使用TextareaItem组件并设置autoHeight
  2. 在一个页面上使用多个TextareaItem组件,都具有自动高度
  3. 从上到下一个一个输入一点字
  4. 下面有些TextareaItem输入时就会自动滚动页面,刚开始以为是focus问题,怎么设置都关闭不了
  5. 然后升级ng到11,然后使用5.0.x的版本发现还是这样,然后将autoHeight设置关闭就没有该问题了

其他发现

在react版本有人提过该问题 - TextareaItem autoHeight 时,频幕滚动问题 · Issue #1858 · ant-design/ant-design-mobile,貌似修复了;但是在ng版本,我搜索到某一次fix又把相关代码去除了,所以有点迷糊:ng版本去除的commit

相关代码


    <TextareaItem class="b-r" [autoHeight]="true" [count]="count" [rows]="rows" [(ngModel)]="commentText"
        [ngClass]="{'one-rows':rows===1,'focus':forceFocus}" [placeholder]="'请输入评论'" [autoFocus]="true">
    </TextareaItem>

你期待的结果是什么?实际看到的错误信息又是什么?

输入的时候autoHeight能正常生效,也不会莫名其妙浏览器自行滚动

阅读 1.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题