fix: dropdown click close for contextmenu #4198

pull/4222/head
tangjinzhou 2021-06-11 21:48:12 +08:00
parent ce6f44f918
commit 0cf37b3f8e
2 changed files with 3 additions and 4 deletions

View File

@ -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;

View File

@ -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,