pzedu
pzedu
  • 发布:2025-01-16 14:26
  • 更新:2025-02-05 18:37
  • 阅读:172

【报Bug】安卓手动收起键盘后,触发touch事件会导致键盘弹出

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 4.29

手机系统: Android

手机系统版本号: Android 15

手机厂商: 小米

手机机型: 小米15

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

<textarea  @keyboardheightchange="keyboardheightchange" placeholder-class="placeholder" name="" id="" cols="30" rows="10" class="textarea" adjust-position="false" maxlength="400" v-model="sendForm.content"></textarea>  
<view class="van-circle__text" @touchstart.prevent="voiceStart" @touchend.prevent="voiceSend">{{cn_en_list[767]}}</view>

操作步骤:

在安卓手机上点击输入框---弹出键盘---点击键盘上面的收起按钮收起键盘---触发其他板块的touch事件键盘会弹出

预期结果:

键盘没有弹出

实际结果:

弹出键盘

bug描述:

触发touch事件会导致键盘弹出(touch事件和输入框没有任何关联)

2025-01-16 14:26 负责人:DCloud_UNI_OttoJi 分享
已邀请:
pzedu

pzedu (作者)

我尝试重新创建一个默认模板的基础项目,并在首页添加了上述的两行代码,也可以复现出来我上面提到的bug,示例代码压缩包也上传了,希望尽快回复

pzedu

pzedu (作者)

操作步骤在附件里面有

pzedu

pzedu (作者)

1111

DCloud_UNI_OttoJi

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

我测试安卓有这个问题,ios 上表现正常

  • pzedu (作者)

    对,ios是正常的

    2025-01-22 08:57

DCloud_UNI_OttoJi

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

经过我测试,不使用 uni-app,使用 vue3 vite 创建普通项目,运行到 h5 平台,然后在安卓手机浏览器中打开,使用下面的 demo 也会让键盘弹起。改为 click 不会。

<template>  
    <view class="content">  
    <textarea placeholder="这里是textarea"  placeholder-class="placeholder" name="" id="" cols="30" rows="10" class="textarea" adjust-position="false" maxlength="400" v-model="sendForm.content"></textarea>    
    <view class="van-circle__text" style="margin-top: 40px;" @touchend.prevent="voiceSend">触摸8</view>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                title: 'Hello',  
        sendForm : {  
          content : ''  
        }  
            }  
        },  
        onLoad() {  

        },  
        methods: {  
      voiceStart(){  
        console.log(111)  
      },  
      voiceSend(){  
        console.log(222)  
      }  
        }  
    }  
</script>  

<style>  
  .textarea{  
    background-color: skyblue;  
  }  
  .van-circle__text{  
    width: 100px;  
    height: 40px;  
    background-color: #000;  
    color: #fff;  
  }  
    .content {  
        display: flex;  
        flex-direction: column;  
        align-items: center;  
        justify-content: center;  
    }  

    .logo {  
        height: 200rpx;  
        width: 200rpx;  
        margin-top: 200rpx;  
        margin-left: auto;  
        margin-right: auto;  
        margin-bottom: 50rpx;  
    }  

    .text-area {  
        display: flex;  
        justify-content: center;  
    }  

    .title {  
        font-size: 36rpx;  
        color: #8f8f94;  
    }  
</style>  
  • DCloud_UNI_OttoJi

    uniapp 在使用 webview 展示内容时候表现和安卓手机浏览器一致

    2025-02-05 18:38

  • pzedu (作者)

    回复 DCloud_UNI_OttoJi: 所以可以解决吗,总不能就不适用touch吧

    2025-02-06 10:15

  • pzedu (作者)

    意思是这个问题暂时是无法解决的是吗

    2025-02-07 17:48

要回复问题请先登录注册