diff --git a/packages/dropdown-menu/test/__snapshots__/index.spec.js.snap b/packages/dropdown-menu/test/__snapshots__/index.spec.js.snap
index a0c2a521b..35ac9efe9 100644
--- a/packages/dropdown-menu/test/__snapshots__/index.spec.js.snap
+++ b/packages/dropdown-menu/test/__snapshots__/index.spec.js.snap
@@ -37,7 +37,7 @@ exports[`close on click outside 1`] = `
B
-
+
@@ -83,7 +83,7 @@ exports[`direction up 1`] = `
B
-
+
@@ -115,7 +115,7 @@ exports[`show dropdown item 1`] = `
B
-
+
@@ -150,7 +150,7 @@ exports[`show dropdown item 2`] = `
B
-
+
`;
@@ -182,7 +182,7 @@ exports[`show dropdown item 3`] = `
B
-
+
`;
diff --git a/packages/mixins/popup/index.js b/packages/mixins/popup/index.js
index fccf74476..5670ee408 100644
--- a/packages/mixins/popup/index.js
+++ b/packages/mixins/popup/index.js
@@ -73,8 +73,8 @@ export const PopupMixin = {
}
},
+ /* istanbul ignore next */
activated() {
- /* istanbul ignore next */
if (this.value) {
this.open();
}
@@ -88,8 +88,8 @@ export const PopupMixin = {
}
},
+ /* istanbul ignore next */
deactivated() {
- /* istanbul ignore next */
this.close();
},
@@ -171,6 +171,7 @@ export const PopupMixin = {
if (this.overlay) {
openOverlay(this, {
zIndex: context.zIndex++,
+ duration: this.duration,
className: this.overlayClass,
customStyle: this.overlayStyle
});
diff --git a/packages/overlay/index.tsx b/packages/overlay/index.tsx
index 73c835492..a7f9b78ea 100644
--- a/packages/overlay/index.tsx
+++ b/packages/overlay/index.tsx
@@ -1,4 +1,4 @@
-import { use } from '../utils';
+import { use, isDef } from '../utils';
import { inherit } from '../utils/functional';
import { preventDefault } from '../utils/dom/event';
@@ -10,6 +10,7 @@ export type OverlayProps = {
zIndex?: number;
className?: any;
visible?: boolean;
+ duration: number | null;
customStyle?: object;
};
@@ -29,11 +30,15 @@ function Overlay(
slots: DefaultSlots,
ctx: RenderContext
) {
- const style = {
+ const style: { [key: string]: any } = {
zIndex: props.zIndex,
...props.customStyle
};
+ if (isDef(props.duration)) {
+ style.animationDuration = `${props.duration}s`;
+ }
+
return (
(Overlay);