Merge branch 'loongMa-master'
This commit is contained in:
commit
0262533133
17
src/Table.js
17
src/Table.js
|
@ -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 = () =>{
|
||||
|
|
Loading…
Reference in New Issue