Merge branch 'loongMa-master'

This commit is contained in:
izbz wh 2020-11-19 19:55:08 +08:00
commit 0262533133
1 changed files with 20 additions and 7 deletions

View File

@ -1286,11 +1286,23 @@ class Table extends Component {
isRowExpanded(record, index) {
return typeof this.findExpandedRow(record, index) !== 'undefined';
}
clearBodyMouseLeaveTimer = () => {
if (this.bodyMouseLeaveTimmer) {
clearTimeout(this.bodyMouseLeaveTimmer)
this.bodyMouseLeaveTimmer = null
}
}
onBodyMouseLeave(e){
this.hideHoverDom(e);
const {onBodyMouseLeave} = this.props;
if(onBodyMouseLeave) {
onBodyMouseLeave()
if (typeof onBodyMouseLeave === 'function') {
this.clearBodyMouseLeaveTimer();
//因为鼠标移动到 hoverContent 中也会触发 onBodyMouseLeave这是错误的
//所以讲 onBodyMouseLeave 回调的调用放入 setTimeout中
// 当触发 hoverContent 的 onRowHoverMouseEnter 回调时,清除此定时器
this.bodyMouseLeaveTimmer = setTimeout(onBodyMouseLeave, 0)
}
}
@ -1418,6 +1430,7 @@ class Table extends Component {
currentHoverKey: this.currentHoverKey,
});
this.hoverDom.style.display = 'block';
this.clearBodyMouseLeaveTimer();
}
onRowHoverMouseLeave = () =>{