Skip to content

ant-picker onOk和onCancel的冒泡bug #1465

Open
@lerity-yao

Description

@lerity-yao

组件

ant-picker

基础库版本

2.x

设备机型

手机系统

[ ] Android

APP

支付宝小程序,顶顶小程序

组件库版本

3.1.12

把 ant-picker放到 ant-list中,ant-list设置onTap事件,点击 ant-picker的取消或者确定或者蒙层,会触发 ant-list的onTap事件

<ant-list-item arrow="right">
        测试
        <view slot="extra" catchTap="handle1">
          <ant-picker
            readonly="{{true}}"
            placeholder=""
            title=""
            emptyText="暂无数据"
            visible="{{show}}"
            options="{{options}}"
            onOk="handleOk"
            onVisibleChange="handleChange"
          >
          </ant-picker>
        </view>
      </ant-list-item>

点击确认,会触发handleOk,这个是正常的,会触发 handleChange,是正常的,但是会触发handle1,这个不正常。

建议picker的源码中 onOk事件以及onCancel事件改成catchTap

除了picker有问题,其他组件都应该有类似的问题,比如ant-cascader-picker

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions