收藏
回答

textarea弹起延迟?

机型iphone14 pro

textarea 弹起速度缓慢

代码用的基本就是你们的示例代码,点击最下面的使得输入框获取焦点即可复现

<view class="page-body">
    <view class="page-section">
        <view class="page-section-title">输入区域高度自适应,不会出现滚动条</view>
        <view class="textarea-wrp">
            <textarea bindblur="bindTextAreaBlur" auto-height />
        </view>
    </view>


    <view class="page-section">
        <view class="page-section-title">这是一个可以自动聚焦的textarea</view>
        <view class="textarea-wrp">
            <textarea auto-focus="true" style="height: 3em" />
        </view>
    </view>
    <view class="section">
        <form bindsubmit="bindFormSubmit">
            <textarea placeholder="form 中的 textarea" name="textarea" />
            <button form-type="submit"> 提交 </button>
        </form>
    </view>
    <view class="section">
        <form bindsubmit="bindFormSubmit">
            <textarea placeholder="form 中的 textarea" name="textarea" />
            <button form-type="submit"> 提交 </button>
        </form>
    </view>
    <view class="section">
        <textarea placeholder="这个只有在按钮点击的时候才聚焦" focus="{{focus}}" />
        <view class="btn-area">
            <button bindtap="bindButtonTap">使得输入框获取焦点</button>
        </view>
    </view>
</view>

//textarea.js
Page({
  data: {
    height: 20,
    focus: false
  },
  bindButtonTap: function() {
    this.setData({
      focus: true
    })
  },
  bindTextAreaBlur: function(e) {
    console.log(e.detail.value)
  },
  bindFormSubmit: function(e) {
    console.log(e.detail.value.textarea)
  }
})
回答关注问题邀请回答
收藏

3 个回答

  • jjblingbling
    jjblingbling
    2022-11-29

    input 框没问题,textarea框顶起有延时

    2022-11-29
    有用
    回复 1
    • yh
      yh
      2023-05-18
      请问下,这个问题有办法处理吗
      2023-05-18
      回复
  • Riven.
    Riven.
    2022-10-18

    你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

    2022-10-18
    有用
    回复
  • ⅴ
    2022-10-17

    啊这,看到这里就 不想买14了。

    2022-10-17
    有用
    回复
登录 后发表内容