收藏
回答

view内部存在button与input,单击view中的任何位置都会触发button事件?

<view class="i-class i-cell i-input" wx:for="{{telephone}}">

<view class="i-cell-hd i-input-title">电话</view>

<input wx:if="{{ item.show }}" type="number" value="{{ item.disnum }}" style="width:30px" bindinput="phone" id="{{ item.id }}"/>

<view wx:if="{{ item.show }}">-</view>

<input type="number" value="{{ item.phone }}" class="i-input-input i-cell-bd" style="margin-left:10px" placeholder-class="i-input-placeholder" id="{{ item.id }}" bindinput="myphone"/>

<button bindtap="phoneadd" class="i-but" id="{{ item.id }}"><cover-image style="width:20px;height:20px" src="{{ item.img }}"/></button>

</view>

在一行内放入输入框和button,单击view内任何位置都会触发button事件,在开发者工具上没问题,实机iPhone xr出了问题,求解

回答关注问题邀请回答
收藏

2 个回答

  • 是柿子啊
    是柿子啊
    2020-05-13

      button有设置这个属性? position: static;


    2020-05-13
    有用
    回复 2
    • 冫泠伈
      冫泠伈
      2020-05-14
      设置了.i-but{border-width: 0;padding: 0;background: none;position: static;font-size:12px;color:#80848f}
      2020-05-14
      回复
    • 是柿子啊
      是柿子啊
      2020-05-17回复冫泠伈
      删掉试下
      2020-05-17
      回复
  • JIang
    JIang
    2020-05-13

    能给个代码片段看看么

    2020-05-13
    有用
    回复 1
    • 冫泠伈
      冫泠伈
      2020-05-14
      .i-cell{position:relative;padding:12px 15px;display:flex;background:#fff;align-items:center;line-height:1.4;font-size:14px;overflow:hidden}
      .i-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px;left:15px;right:0}
      .i-cell-last::after{display:none}
      .i-cell-icon{margin-right:5px}
      .i-cell-icon:empty{display:none}
      .i-cell-bd{flex:1}
      .i-cell-text{line-height:24px;font-size:14px}
      .i-cell-desc{line-height:1.2;font-size:12px;color:#80848f}
      .i-cell-ft{position:relative;text-align:right;color:#495060}
      .i-cell-access .i-cell-ft{padding-right:13px}
      .i-cell-access .i-cell-ft::after{content:" ";display:inline-block;width:6px;height:6px;position:absolute;top:50%;right:2px;border-width:2px 2px 0 0;border-color:#dddee1;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}
      .i-input{padding:7px 15px;color:#495060}
      .i-input-wrapped{margin:10px 15px;background-color:#fff}
      .i-input-wrapped::after{left:0;border-width:1px;border-radius:4px}
      .i-input-error{color:#ed3f14}
      .i-input-title{color:#495060;min-width:65px;padding-right:10px}
      .i-input-input{flex:1;line-height:1.6;padding:4px 0;min-height:22px;height:auto;font-size:14px}
      .i-input-placeholder{font-size:14px}
      .i-input-input-right{text-align:right}
      .i-input
      .i-input-wrapped::after{display:block}
      .i-input-wrapped
      .i-input-error::after{border-color:#ed3f14}
      .i-but{border-width: 0;padding: 0;background: none;position: static;font-size:12px;color:#80848f}
      .s-icon{flex:1;line-height:1.6;padding:4px 0;height:20px;width:15px;font-size:14px}这部分差不多就是用到的样式
      2020-05-14
      回复
登录 后发表内容
问题标签