From 93df00ce855af2f65a26fba9d688493bd39a2ea7 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 3 Dec 2019 17:48:41 +0800 Subject: [PATCH] fix(ActionSheet): should not submit form (#5181) --- src/action-sheet/index.tsx | 9 +++++++-- .../test/__snapshots__/index.spec.js.snap | 12 ++++++------ src/swipe/README.zh-CN.md | 4 ++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/action-sheet/index.tsx b/src/action-sheet/index.tsx index 2f395e88f..a392119eb 100644 --- a/src/action-sheet/index.tsx +++ b/src/action-sheet/index.tsx @@ -53,7 +53,11 @@ function ActionSheet( return (
{title} - +
); } @@ -99,6 +103,7 @@ function ActionSheet( return ( ); diff --git a/src/action-sheet/test/__snapshots__/index.spec.js.snap b/src/action-sheet/test/__snapshots__/index.spec.js.snap index ac00f117a..2632f09b2 100644 --- a/src/action-sheet/test/__snapshots__/index.spec.js.snap +++ b/src/action-sheet/test/__snapshots__/index.spec.js.snap @@ -1,9 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`callback events 1`] = ` -
+ `; exports[`close-icon prop 1`] = ` @@ -13,15 +13,15 @@ exports[`close-icon prop 1`] = ` `; -exports[`color option 1`] = `
`; +exports[`color option 1`] = `
`; exports[`description prop 1`] = `
-
This is a description
+
This is a description
`; -exports[`disable lazy-render 1`] = ``; +exports[`disable lazy-render 1`] = ``; exports[`render title and default slot 1`] = `
@@ -31,4 +31,4 @@ exports[`render title and default slot 1`] = `
`; -exports[`round prop 1`] = `
`; +exports[`round prop 1`] = `
`; diff --git a/src/swipe/README.zh-CN.md b/src/swipe/README.zh-CN.md index 8d4b4ffc2..6e06c816c 100644 --- a/src/swipe/README.zh-CN.md +++ b/src/swipe/README.zh-CN.md @@ -186,6 +186,6 @@ export default { ### 滑动轮播时为什么触发了 click 事件? -这种情况通常是由于项目中引入了`fastclick`库导致的,`fastclick`会在滑动过程中触发`click`事件。 +这种情况通常是由于项目中引入了`fastclick`库导致的。`fastclick`的原理是通过 Touch 事件模拟出 click 事件,而 Swipe 内部默认会阻止 touchmove 事件冒泡,干扰了 fastclick 的判断,导致出现这个问题。 -将 Swipe 组件的 stop-propagation 属性设置为 false 即可避免这个问题。 +将 Swipe 组件的 stop-propagation 属性设置为 false 即可避免该问题。