From 0cf37b3f8ee3ddc5f0dd77c616a95e897f07b84f Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Fri, 11 Jun 2021 21:48:12 +0800 Subject: [PATCH] fix: dropdown click close for contextmenu #4198 --- components/dropdown/dropdown.tsx | 2 +- components/vc-dropdown/src/Dropdown.jsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/dropdown/dropdown.tsx b/components/dropdown/dropdown.tsx index 5424150b9..143ed3d31 100644 --- a/components/dropdown/dropdown.tsx +++ b/components/dropdown/dropdown.tsx @@ -92,7 +92,7 @@ const Dropdown = defineComponent({ class: classNames(child?.props?.class, `${prefixCls}-trigger`), disabled, }); - const triggerActions = disabled ? [] : trigger; + const triggerActions = disabled ? [] : typeof trigger === 'string' ? [trigger] : trigger; let alignPoint; if (triggerActions && triggerActions.indexOf('contextmenu') !== -1) { alignPoint = true; diff --git a/components/vc-dropdown/src/Dropdown.jsx b/components/vc-dropdown/src/Dropdown.jsx index 318b67032..b80da0eeb 100644 --- a/components/vc-dropdown/src/Dropdown.jsx +++ b/components/vc-dropdown/src/Dropdown.jsx @@ -29,8 +29,8 @@ export default defineComponent({ 'hover', ), alignPoint: PropTypes.looseBool, - showAction: PropTypes.array.def([]), - hideAction: PropTypes.array.def([]), + showAction: PropTypes.array, + hideAction: PropTypes.array, getPopupContainer: PropTypes.func, visible: PropTypes.looseBool, defaultVisible: PropTypes.looseBool.def(false), @@ -177,7 +177,6 @@ export default defineComponent({ if (!triggerHideAction && trigger.indexOf('contextmenu') !== -1) { triggerHideAction = ['click']; } - const triggerProps = { ...otherProps, prefixCls,