Browse Source

fix: dropdown click close for contextmenu #4198

pull/4222/head
tangjinzhou 3 years ago
parent
commit
0cf37b3f8e
  1. 2
      components/dropdown/dropdown.tsx
  2. 5
      components/vc-dropdown/src/Dropdown.jsx

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

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

Loading…
Cancel
Save