Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.solid 子元素点击事件无效 #10

Closed
metanoia1989 opened this issue Nov 12, 2018 · 1 comment
Closed

.solid 子元素点击事件无效 #10

metanoia1989 opened this issue Nov 12, 2018 · 1 comment
Labels
已经完成 现在的版本已经解决(优化)了这个问题 错误 最近的版本要解决它

Comments

@metanoia1989
Copy link

metanoia1989 commented Nov 12, 2018

代码如下
test.wxml

<view class="solid box">
  <button bindtap="clickConsole" class="btn primary">测试 solid </button>
</view>

test.js

Page({
  clickConsole: function() {
    console.log('click!');
  }
})

css也能导致按钮的bindtap事件失效,发现把.solid::after的宽度高度设为100%就可以了,或者加上pointer-events: none

.solid::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    content: " ";
    -webkit-transform: scale(.5);
    transform: scale(.5);
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    pointer-events: none
}
@wen-gang
Copy link
Collaborator

已解决,在wcss中加入了pointer-events: none

@wen-gang wen-gang added 错误 最近的版本要解决它 已经完成 现在的版本已经解决(优化)了这个问题 labels Feb 21, 2019
@wen-gang wen-gang reopened this Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
已经完成 现在的版本已经解决(优化)了这个问题 错误 最近的版本要解决它
Projects
None yet
Development

No branches or pull requests

2 participants