Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(message): add animation of faddeIn and fadeOut #405

Merged
merged 2 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: handle unit test error of message
  • Loading branch information
Zack921 committed Mar 8, 2022
commit ece64d5daf3b21457baa33aa48d937b6a7afae54
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@
"lodash": "^4.17.21",
"raf": "^3.4.1",
"tdesign-icons-vue": "~0.0.8",
"validator": "^13.5.1",
"web-animations-js": "^2.3.2"
"validator": "^13.5.1"
},
"peerDependencies": {
"vue": "^2.6.10"
Expand Down
2 changes: 1 addition & 1 deletion src/message/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function fadeOut(dom: HTMLElement, placement: string, onFinish: Function) {
if (!dom) return;
const offsetHeight = dom?.offsetHeight || 0;
const fadeOutKeyframes: Array<Keyframe> | null = getFadeOutKeyframes(placement, offsetHeight);
if (!fadeOutKeyframes) return;
if (!fadeOutKeyframes) return onFinish();
const styleAfterFadeOut = fadeOutKeyframes[fadeOutKeyframes.length - 1];
setDomStyleAfterAnimation(dom, styleAfterFadeOut);

Expand Down
1 change: 0 additions & 1 deletion src/message/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'web-animations-js'; // web animations polyfill
import _Message from './message';
import withInstall from '../utils/withInstall';
import { TdMessageProps } from './type';
Expand Down