请选择 进入手机版 | 继续访问电脑版
帖子
帖子
用户
博客
课程
显示全部楼层
1
帖子
0
勋章
13
Y币

[App引擎] position定位超出父元素边界的元素会无法触发点击事件

[复制链接]
发表于 2022-5-26 16:05:04
position定位超出父元素边界的元素在真机上会无法触发点击事件

<template name='tpl'>
        <view class="page">
                <safe-area class="header">
                        <text class="header__title">APICloud</text>
                </safe-area>
                <view class="content">
                        <view class="fatherBox" @click="fatherBoxClick">
                                <view class="childrenBox1" @click="childrenBoxClick"></view>
                                <view class="childrenBox2" @click="childrenBoxClick"></view>
                        </view>
                </view>
                <safe-area class="footer">
                       
                </safe-area>
        </view>
</template>
<script>
export default {
        name: "tpl",
        apiready() {
                api.setStatusBarStyle({
                        style: "light",
                        color: "-"
                });
        },
        data() {
                return {
                       
                };
        },
        methods: {
                fatherBoxClick() {
            console.log(1)
                        api.alert({
                                title: '提示',
                                msg: 'fatherBox被点击',
                        }, function (ret, err) {

                        });
                },
                childrenBoxClick() {
            console.log(2)
                        api.alert({
                                title: '提示',
                                msg: 'childrenBox被点击',
                        }, function (ret, err) {

                        });
                }
        }
};
</script>
<style>
.page {
        height: 100%;
        background-color: white;
}
.header {
        background: #81a9c3;
        justify-content: center;
        align-items: center;
}
.header__title {
        color: #fff;
        font-size: 18px;
        font-weight: bold;
        height: 50px;
        line-height: 50px;
}

.footer {
        background: #81a9c3;
        flex-direction: row;
        justify-content: center;
        align-items: center;
}

.footer__text {
        color: #fff;
        font-size: 14px;
        height: 30px;
        line-height: 30px;
}
.content {
        width: 100%;
        flex: 1;
        position: relative;
}
.fatherBox {
        width: 200px;
        height: 200px;
        background-color: green;
        position: absolute;
        top: 50px;
        left: 100px;
}
.childrenBox1 {
        width: 100px;
        height: 100px;
        background-color: red;
        position: absolute;
        top: 50px;
        left: -50px;
}
.childrenBox2 {
        width: 100px;
        height: 100px;
        background-color: red;
        position: absolute;
        top: 250px;
        left: -50px;
}
</style>

我这边测试一下你的代码
确实有问题,我提jira了,开发那边修复了回复你
留意一下后续的发版公告,
1
帖子
0
勋章
13
Y币
您好,我在APICloud_SDK_v1.4.16版本公告内没看到相关修复的说明,这个问题是还需要继续修复吗?
技术咨询-特特 · 2022-5-31 18:07留意一下后续的发版公告,
20
帖子
1
勋章
7559
Y币
该问题已修复,重新编译app或自定义loader试试看。
您需要登录后才可以回帖 登录

本版积分规则