mirror of
https://github.com/apache/superset.git
synced 2024-09-18 19:49:37 -04:00
fix(dashboard): fix Pivot Table V2 dragPreview in the dashboard (#21539)
This commit is contained in:
parent
60bab4269f
commit
ab53d77aba
@ -20,9 +20,9 @@
|
|||||||
import { css, styled } from '@superset-ui/core';
|
import { css, styled } from '@superset-ui/core';
|
||||||
|
|
||||||
export const Styles = styled.div`
|
export const Styles = styled.div`
|
||||||
${({ theme }) => css`
|
${({ theme, isDashboardEditMode }) => css`
|
||||||
table.pvtTable {
|
table.pvtTable {
|
||||||
position: relative;
|
position: ${isDashboardEditMode ? 'inherit' : 'relative'};
|
||||||
font-size: ${theme.typography.sizes.s}px;
|
font-size: ${theme.typography.sizes.s}px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin: ${theme.gridUnit}px;
|
margin: ${theme.gridUnit}px;
|
||||||
@ -32,7 +32,7 @@ export const Styles = styled.div`
|
|||||||
}
|
}
|
||||||
|
|
||||||
table thead {
|
table thead {
|
||||||
position: sticky;
|
position: ${isDashboardEditMode ? 'inherit' : 'sticky'};
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ export const Styles = styled.div`
|
|||||||
}
|
}
|
||||||
|
|
||||||
table.pvtTable tbody tr.pvtRowTotals {
|
table.pvtTable tbody tr.pvtRowTotals {
|
||||||
position: sticky;
|
position: ${isDashboardEditMode ? 'inherit' : 'sticky'};
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -826,6 +826,10 @@ export class TableRenderer extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isDashboardEditMode() {
|
||||||
|
return document.contains(document.querySelector('.dashboard--editing'));
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.cachedProps !== this.props) {
|
if (this.cachedProps !== this.props) {
|
||||||
this.cachedProps = this.props;
|
this.cachedProps = this.props;
|
||||||
@ -867,7 +871,7 @@ export class TableRenderer extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Styles>
|
<Styles isDashboardEditMode={this.isDashboardEditMode()}>
|
||||||
<table className="pvtTable" role="grid">
|
<table className="pvtTable" role="grid">
|
||||||
<thead>
|
<thead>
|
||||||
{colAttrs.map((c, j) =>
|
{colAttrs.map((c, j) =>
|
||||||
|
Loading…
Reference in New Issue
Block a user