fix(ActionSheet): should not submit form (#5181)

This commit is contained in:
neverland
2019-12-03 17:48:41 +08:00
committed by GitHub
parent 2bc3ae2b60
commit 93df00ce85
3 changed files with 15 additions and 10 deletions

View File

@@ -53,7 +53,11 @@ function ActionSheet(
return (
<div class={[bem('header'), BORDER_BOTTOM]}>
{title}
<Icon name={props.closeIcon} class={bem('close')} onClick={onCancel} />
<Icon
name={props.closeIcon}
class={bem('close')}
onClick={onCancel}
/>
</div>
);
}
@@ -99,6 +103,7 @@ function ActionSheet(
return (
<button
type="button"
class={[bem('item', { disabled }), item.className, BORDER_TOP]}
style={{ color: item.color }}
onClick={onClickOption}
@@ -111,7 +116,7 @@ function ActionSheet(
function CancelText() {
if (cancelText) {
return (
<button class={bem('cancel')} onClick={onCancel}>
<button type="button" class={bem('cancel')} onClick={onCancel}>
{cancelText}
</button>
);