fix:行destory时,hoverDom
This commit is contained in:
parent
37b9806507
commit
c0d9531a0a
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bee-table",
|
||||
"version": "2.0.3-beta.0",
|
||||
"version": "2.0.4",
|
||||
"description": "Table ui component for react",
|
||||
"keywords": [
|
||||
"react",
|
||||
|
|
31
src/Table.js
31
src/Table.js
|
@ -320,6 +320,10 @@ class Table extends Component {
|
|||
if (index !== -1) {
|
||||
expandedRows.splice(index, 1);
|
||||
}
|
||||
//
|
||||
if(this.currentHoverKey == rowKey && this.hoverDom){
|
||||
this.hoverDom.style.display = 'none';
|
||||
}
|
||||
this.onExpandedRowsChange(expandedRows);
|
||||
}
|
||||
|
||||
|
@ -1114,20 +1118,23 @@ class Table extends Component {
|
|||
currentHoverKey: isHover ? key : null,
|
||||
});
|
||||
}
|
||||
if(this.hoverDom && isHover){
|
||||
this.currentHoverKey = key;
|
||||
const td = closest(event.target,'td');
|
||||
if(td){
|
||||
const scrollTop = this.lastScrollTop ?this.lastScrollTop:0
|
||||
let top = td.offsetTop - scrollTop;
|
||||
if(this.refs.headTable){
|
||||
top = top + this.refs.headTable.clientHeight;
|
||||
if(this.hoverDom){
|
||||
if(isHover){
|
||||
this.currentHoverKey = key;
|
||||
const td = closest(event.target,'td');
|
||||
if(td){
|
||||
const scrollTop = this.lastScrollTop ?this.lastScrollTop:0
|
||||
let top = td.offsetTop - scrollTop;
|
||||
if(this.refs.headTable){
|
||||
top = top + this.refs.headTable.clientHeight;
|
||||
}
|
||||
this.hoverDom.style.top = top + 'px';
|
||||
this.hoverDom.style.height = td.offsetHeight + 'px';
|
||||
this.hoverDom.style.lineHeight = td.offsetHeight + 'px';
|
||||
this.hoverDom.style.display = 'block';
|
||||
}
|
||||
this.hoverDom.style.top = top + 'px';
|
||||
this.hoverDom.style.height = td.offsetHeight + 'px';
|
||||
this.hoverDom.style.lineHeight = td.offsetHeight + 'px';
|
||||
this.hoverDom.style.display = 'block';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onRowHover && onRowHover(currentIndex,record);
|
||||
|
|
Loading…
Reference in New Issue