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",
|
"name": "bee-table",
|
||||||
"version": "2.0.3-beta.0",
|
"version": "2.0.4",
|
||||||
"description": "Table ui component for react",
|
"description": "Table ui component for react",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
|
|
31
src/Table.js
31
src/Table.js
|
@ -320,6 +320,10 @@ class Table extends Component {
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
expandedRows.splice(index, 1);
|
expandedRows.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
if(this.currentHoverKey == rowKey && this.hoverDom){
|
||||||
|
this.hoverDom.style.display = 'none';
|
||||||
|
}
|
||||||
this.onExpandedRowsChange(expandedRows);
|
this.onExpandedRowsChange(expandedRows);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1114,20 +1118,23 @@ class Table extends Component {
|
||||||
currentHoverKey: isHover ? key : null,
|
currentHoverKey: isHover ? key : null,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(this.hoverDom && isHover){
|
if(this.hoverDom){
|
||||||
this.currentHoverKey = key;
|
if(isHover){
|
||||||
const td = closest(event.target,'td');
|
this.currentHoverKey = key;
|
||||||
if(td){
|
const td = closest(event.target,'td');
|
||||||
const scrollTop = this.lastScrollTop ?this.lastScrollTop:0
|
if(td){
|
||||||
let top = td.offsetTop - scrollTop;
|
const scrollTop = this.lastScrollTop ?this.lastScrollTop:0
|
||||||
if(this.refs.headTable){
|
let top = td.offsetTop - scrollTop;
|
||||||
top = top + this.refs.headTable.clientHeight;
|
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);
|
onRowHover && onRowHover(currentIndex,record);
|
||||||
|
|
Loading…
Reference in New Issue