fix: Auto complete dropdown flickers #1327
parent
1208649a9e
commit
a4c2a0e020
|
@ -54,7 +54,7 @@ function clearBrowserBugTimeout(node) {
|
||||||
const cssAnimation = (node, transitionName, endCallback) => {
|
const cssAnimation = (node, transitionName, endCallback) => {
|
||||||
const nameIsObj = typeof transitionName === 'object';
|
const nameIsObj = typeof transitionName === 'object';
|
||||||
const className = nameIsObj ? transitionName.name : transitionName;
|
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 end = endCallback;
|
||||||
let start;
|
let start;
|
||||||
let active;
|
let active;
|
||||||
|
@ -83,10 +83,7 @@ const cssAnimation = (node, transitionName, endCallback) => {
|
||||||
clearBrowserBugTimeout(node);
|
clearBrowserBugTimeout(node);
|
||||||
|
|
||||||
nodeClasses.remove(className);
|
nodeClasses.remove(className);
|
||||||
activeClassName.split(' ').forEach((className)=>{
|
nodeClasses.remove(activeClassName);
|
||||||
nodeClasses.remove(className);
|
|
||||||
});
|
|
||||||
//nodeClasses.remove(activeClassName);
|
|
||||||
|
|
||||||
Event.removeEndEventListener(node, node.rcEndListener);
|
Event.removeEndEventListener(node, node.rcEndListener);
|
||||||
node.rcEndListener = null;
|
node.rcEndListener = null;
|
||||||
|
@ -107,10 +104,7 @@ const cssAnimation = (node, transitionName, endCallback) => {
|
||||||
|
|
||||||
node.rcAnimTimeout = requestAnimationTimeout(() => {
|
node.rcAnimTimeout = requestAnimationTimeout(() => {
|
||||||
node.rcAnimTimeout = null;
|
node.rcAnimTimeout = null;
|
||||||
// nodeClasses.add(activeClassName);
|
nodeClasses.add(activeClassName);
|
||||||
activeClassName.split(' ').forEach((className)=>{
|
|
||||||
nodeClasses.add(className);
|
|
||||||
});
|
|
||||||
if (active) {
|
if (active) {
|
||||||
requestAnimationTimeout(active, 0);
|
requestAnimationTimeout(active, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
beforeUpdate() {
|
beforeUpdate() {
|
||||||
if(this.domEl && this.domEl.rcEndListener) {
|
if (this.domEl && this.domEl.rcEndListener) {
|
||||||
this.domEl.rcEndListener();
|
this.domEl.rcEndListener();
|
||||||
this.domEl = null;
|
this.domEl = null;
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ export default {
|
||||||
// this.$refs.alignInstance.forceAlign();
|
// this.$refs.alignInstance.forceAlign();
|
||||||
},
|
},
|
||||||
enter: (el, done) => {
|
enter: (el, done) => {
|
||||||
// align updated后执行动画
|
// render 后 vue 会移除通过animate动态添加的 class导致动画闪动,延迟两帧添加动画class,可以进一步定位或者重写 transition 组件
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$refs.alignInstance) {
|
if (this.$refs.alignInstance) {
|
||||||
this.$refs.alignInstance.$nextTick(() => {
|
this.$refs.alignInstance.$nextTick(() => {
|
||||||
|
@ -229,8 +229,10 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
leave: (el, done) => {
|
beforeLeave: () => {
|
||||||
this.domEl = null;
|
this.domEl = null;
|
||||||
|
},
|
||||||
|
leave: (el, done) => {
|
||||||
animate(el, `${transitionName}-leave`, done);
|
animate(el, `${transitionName}-leave`, done);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue