2***@qq.com
2***@qq.com
  • 发布:2023-09-11 15:33
  • 更新:2023-09-11 15:33
  • 阅读:64

【报Bug】nvue页面,根元素bubble="true" @longpress.stop, e.stopPropagation()这些都用了,但元素第一次longpress依然无法阻止软键盘收起

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

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

HBuilderX类型: 正式

HBuilderX版本号: 3.8.12

手机系统: iOS

手机系统版本号: iOS 13.0

手机厂商: 苹果

手机机型: iPhone XR

页面类型: nvue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

<template>
<view bubble="true" :eventPenetrationEnabled="true">
<view class="bbb" @touchmove.stop="" @touchstart.stop="" @touchend.stop="" @longpress.stop="longpress">
</view>
<input :confirm-hold="true" style="width:750rpx;height:100rpx;border:1px solid red;" type="text" v-model="inputText">
</view>
<!-- <cacheimg class="aaa" style="width:750rpx;height:300rpx;" src="https://slim.obs.cn-south-1.myhuaweicloud.com:443/file%2Fb37a8c8034fd4da09c5ebcf1758b426a.JPG"></cacheimg> -->
</template>

<script setup lang="ts">
import { ref, reactive } from "vue";
import { onReady, onShow, onLoad,onUnload } from "@dcloudio/uni-app";
// import { userData as userDataStore } from "@/store/userData";
// import { systemInfo as systemInfoStore } from "@/store/systemInfo";
// import { getGroupMember } from "@/api/api";
// import { updateGroupProfile } from "@/hooks/imHooks";
// import { config as configStore } from "@/store/config";

//import cacheimg from '@/components/cacheimg.vue'

const goBack = () => {
uni.navigateBack();
};

const longpress = (e:any)=>{
e.stopPropagation();
e.preventDefault();
}

const inputText = ref('')

onReady(() => {});

onLoad((option: any) => {
if (option.groupID) {
}
});

onUnload(() => {});

onShow(() => {});
</script>

<style lang="scss" scoped>

.bbb{
width:750rpx;
height:500rpx;
background:blue;
}

</style>

操作步骤:

1.点击input让键盘弹出
2.长按蓝色部分

预期结果:

键盘不收起

实际结果:

键盘会收起

bug描述:

nvue页面,longpress一定会让键盘收起, 按照weex文档阻止冒泡,效果是 任何一个view第一次 longpress依然会关闭软键盘

2023-09-11 15:33 负责人:无 分享
已邀请:

要回复问题请先登录注册