From 0093e19bf7021d078454ed1286f81dae52f26a3b Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 4 Mar 2021 19:40:30 +0800 Subject: [PATCH] fix(ActionSheet): should not reopen when closed (#8271) --- src/action-sheet/index.tsx | 8 ++++++-- src/action-sheet/test/__snapshots__/index.spec.js.snap | 2 +- src/action-sheet/test/index.spec.js | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/action-sheet/index.tsx b/src/action-sheet/index.tsx index 590bd90b3..d0cf40f47 100644 --- a/src/action-sheet/index.tsx +++ b/src/action-sheet/index.tsx @@ -1,3 +1,5 @@ +import Vue from 'vue'; + // Utils import { createNamespace } from '../utils'; import { emit, inherit } from '../utils/functional'; @@ -89,11 +91,13 @@ function ActionSheet( callback(item); } - emit(ctx, 'select', item, index); - if (props.closeOnClickAction) { emit(ctx, 'input', false); } + + Vue.nextTick(() => { + emit(ctx, 'select', item, index); + }); } function OptionContent() { diff --git a/src/action-sheet/test/__snapshots__/index.spec.js.snap b/src/action-sheet/test/__snapshots__/index.spec.js.snap index 932b1a226..2764b2d66 100644 --- a/src/action-sheet/test/__snapshots__/index.spec.js.snap +++ b/src/action-sheet/test/__snapshots__/index.spec.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`callback events 1`] = ` -
+