[bugfix] AddressList: not trigger select event when click radio icon (#3214)

This commit is contained in:
neverland
2019-04-26 09:25:57 +08:00
committed by GitHub
parent 5889968f29
commit 6fbdc4ffc3
2 changed files with 31 additions and 7 deletions
+13 -7
View File
@@ -36,6 +36,12 @@ function AddressItem(
) {
const { disabled, switchable } = props;
const onSelect = () => {
if (props.switchable) {
emit(ctx, 'select');
}
};
const renderRightIcon = () => (
<Icon
name="edit"
@@ -54,13 +60,13 @@ function AddressItem(
<div class={bem('address')}>{data.address}</div>
];
return props.switchable ? <Radio name={data.id}>{Info}</Radio> : Info;
};
const onSelect = () => {
if (props.switchable) {
emit(ctx, 'select');
}
return props.switchable ? (
<Radio name={data.id} onClick={onSelect}>
{Info}
</Radio>
) : (
Info
);
};
return (