3***@qq.com
3***@qq.com
  • 发布:2025-09-29 10:57
  • 更新:2025-09-29 16:01
  • 阅读:88

【报Bug】textarea设置auto-height后再设置max-height 输入内容超过高度后换行第一次光标不会更随,当值对于内容需要手动滑动

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win11

HBuilderX类型: 正式

HBuilderX版本号: 4.81

手机系统: Android

手机系统版本号: Android 16

手机厂商: OPPO

手机机型: oppo

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

随便一个textarea 只要设置了 max-height 就会出现

预期结果:

当换行时自动向上滚动,显示最后一行的问题

实际结果:

换行后,需要手动滚动,或者继续输入文字才会显示最新一排文字

bug描述:

【报Bug】textarea设置auto-height后再设置max-height 输入内容超过高度后换行第一次光标不会更随,当值对于内容需要手动滑动

2025-09-29 10:57 负责人:无 分享
已邀请:
DCloud_UNI_OttoJi

DCloud_UNI_OttoJi - 日常回复 uni-app/x 问题,如果艾特我没看到,请主动私信

提供完整复现代码。对比下 app 和 web 是否有差异

  • 3***@qq.com (作者)

    <template>

    <textarea class="multi-line-input" v-model="text" cursor-spacing="20" :adjust-position="false" id="msg-input"

    auto-height confirm-type="send" :confirm-hold="true" :show-confirm-bar="false" maxlength="1500"></textarea>

    </template>


    <script setup lang="ts">

    import { ref } from "vue";


    const text = ref('')

    </script>


    <style lang="scss" scoped>

    .multi-line-input {

    width: 100%;

    background-color: yellow;

    max-height: 200px;

    overflow-y: auto;

    resize: none;

    }

    </style> 就是一个普通的textarea 设置了max-height 就会出现这个问题,app和web都有同样的问题

    2025-09-30 14:54

  • DCloud_UNI_OttoJi

    回复 3***@qq.com: 使用 web 和安卓 13 输入大量文字,观察光标位置始终在最后一行,向上滚动文字之后继续输入,光标会定位在最后一行。未能复现你的问题。你可以录个视频说明问题

    2025-09-30 16:22

要回复问题请先登录注册