fix: Auto complete dropdown flickers #1327

pull/1353/head
tanjinzhou 2019-10-25 19:38:04 +08:00
parent 1208649a9e
commit a4c2a0e020
2 changed files with 8 additions and 12 deletions

View File

@ -54,7 +54,7 @@ function clearBrowserBugTimeout(node) {
const cssAnimation = (node, transitionName, endCallback) => {
const nameIsObj = typeof transitionName === 'object';
const className = nameIsObj ? transitionName.name : transitionName;
const activeClassName = nameIsObj ? transitionName.active : `${transitionName} ${transitionName}-active`;
const activeClassName = nameIsObj ? transitionName.active : `${transitionName}-active`;
let end = endCallback;
let start;
let active;
@ -83,10 +83,7 @@ const cssAnimation = (node, transitionName, endCallback) => {
clearBrowserBugTimeout(node);
nodeClasses.remove(className);
activeClassName.split(' ').forEach((className)=>{
nodeClasses.remove(className);
});
//nodeClasses.remove(activeClassName);
nodeClasses.remove(activeClassName);
Event.removeEndEventListener(node, node.rcEndListener);
node.rcEndListener = null;
@ -107,10 +104,7 @@ const cssAnimation = (node, transitionName, endCallback) => {
node.rcAnimTimeout = requestAnimationTimeout(() => {
node.rcAnimTimeout = null;
// nodeClasses.add(activeClassName);
activeClassName.split(' ').forEach((className)=>{
nodeClasses.add(className);
});
nodeClasses.add(activeClassName);
if (active) {
requestAnimationTimeout(active, 0);
}

View File

@ -45,7 +45,7 @@ export default {
});
},
beforeUpdate() {
if(this.domEl && this.domEl.rcEndListener) {
if (this.domEl && this.domEl.rcEndListener) {
this.domEl.rcEndListener();
this.domEl = null;
}
@ -219,7 +219,7 @@ export default {
// this.$refs.alignInstance.forceAlign();
},
enter: (el, done) => {
// align updated
// render vue animate classclass transition
this.$nextTick(() => {
if (this.$refs.alignInstance) {
this.$refs.alignInstance.$nextTick(() => {
@ -229,8 +229,10 @@ export default {
}
});
},
leave: (el, done) => {
beforeLeave: () => {
this.domEl = null;
},
leave: (el, done) => {
animate(el, `${transitionName}-leave`, done);
},
};