Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charting: Tooltip disappear on escape click issue fixed in line chart #16491

Merged
merged 5 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "patch",
"comment": "Tooltip disappear after click on escape issue fixed",
"packageName": "@uifabric/charting",
"email": "[email protected]",
"dependentChangeType": "patch",
"date": "2021-01-15T09:42:29.530Z"
}
12 changes: 10 additions & 2 deletions packages/charting/src/components/LineChart/LineChart.base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ export class LineChartBase extends React.Component<ILineChartProps, ILineChartSt

public componentDidUpdate(prevProps: ILineChartProps): void {
/** note that height and width are not used to resize or set as dimesions of the chart,
* fitParentContainer is responisble for setting the height and width or resizing of the svg/chart
*/
* fitParentContainer is responisble for setting the height and width or resizing of the svg/chart */
if (
prevProps.height !== this.props.height ||
prevProps.width !== this.props.width ||
Expand Down Expand Up @@ -128,6 +127,9 @@ export class LineChartBase extends React.Component<ILineChartProps, ILineChartSt
target: this.state.refSelected,
isBeakVisible: false,
gapSpace: 15,
onDismiss: this._closeCallout,
preventDismissOnEvent: () => true,
hidden: !(!this.props.hideTooltip && this.state.isCalloutVisible),
...this.props.calloutProps,
};
const tickParams = {
Expand Down Expand Up @@ -298,6 +300,12 @@ export class LineChartBase extends React.Component<ILineChartProps, ILineChartSt
return legends;
}

private _closeCallout = () => {
this.setState({
isCalloutVisible: false,
});
};

private _createLines(xElement: SVGElement): JSX.Element[] {
const lines = [];
if (this.state.isSelectedLegend) {
Expand Down