Skip to content
Snippets Groups Projects
Unverified Commit 0ee85271 authored by Dalton's avatar Dalton Committed by GitHub
Browse files

Disable table header info popover when viz is clicked (#19559)

parent 0f6fb363
No related branches found
No related tags found
No related merge requests found
......@@ -16,16 +16,22 @@ const propTypes = {
dimension: PropTypes.instanceOf(Dimension),
children: PropTypes.node,
placement: PropTypes.string,
disabled: PropTypes.bool,
};
type Props = { dimension: Dimension } & Pick<
ITippyPopoverProps,
"children" | "placement"
"children" | "placement" | "disabled"
>;
const className = "dimension-info-popover";
function DimensionInfoPopover({ dimension, children, placement }: Props) {
function DimensionInfoPopover({
dimension,
children,
placement,
disabled,
}: Props) {
// avoid a scenario where we may have a Dimension instance but not enough metadata
// to even show a display name (probably indicative of a bug)
const hasMetadata = !!(dimension && dimension.displayName());
......@@ -36,6 +42,7 @@ function DimensionInfoPopover({ dimension, children, placement }: Props) {
delay={isCypressActive ? 0 : POPOVER_DELAY}
interactive
placement={placement || "left-start"}
disabled={disabled}
content={<WidthBoundDimensionInfo dimension={dimension} />}
onTrigger={instance => {
const dimensionInfoPopovers = document.querySelectorAll(
......
......@@ -131,7 +131,7 @@ export default class TableInteractive extends Component {
}
shouldComponentUpdate(nextProps, nextState) {
const PROP_KEYS = ["width", "height", "settings", "data"];
const PROP_KEYS = ["width", "height", "settings", "data", "clicked"];
// compare specific props and state to determine if we should re-render
return (
!_.isEqual(
......@@ -650,6 +650,7 @@ export default class TableInteractive extends Component {
<DimensionInfoPopover
placement="bottom-start"
dimension={this.getDimension(column, this.props.query)}
disabled={this.props.clicked != null}
>
{renderTableHeaderWrapper(
<Ellipsified tooltip={columnTitle}>
......
......@@ -503,6 +503,7 @@ export default class Visualization extends React.PureComponent {
card={series[0].card} // convenience for single-series visualizations
data={series[0].data} // convenience for single-series visualizations
hovered={hovered}
clicked={clicked}
headerIcon={hasHeader ? null : headerIcon}
onHoverChange={this.handleHoverChange}
onVisualizationClick={this.handleVisualizationClick}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment