changes from PR requests (#6880)

Signed-off-by: Jaga Santagostino <jagasantagostino@gmail.com>
This commit is contained in:
Jaga Santagostino 2020-03-16 08:22:08 +01:00 committed by GitHub
parent 4d6f9b75e2
commit 350f25eed3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,12 +23,12 @@ export class Legend extends PureComponent<LegendProps, LegendState> {
this.setState({ selectedIndexes: [] });
}
}
handleSeriesSelect = (index: number) => (ev: any) => {
handleSeriesSelect = (index: number) => (ev: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
// TODO: add proper event type
const { selectedIndexes } = this.state;
let selected = [index];
if (ev.ctrlKey) {
if (ev.ctrlKey || ev.metaKey) {
const { chartData } = this.props;
if (selectedIndexes.includes(index)) {
selected = selectedIndexes.filter(idx => idx !== index);
@ -68,7 +68,7 @@ export class Legend extends PureComponent<LegendProps, LegendState> {
))}
{chartData.length > 1 && (
<div className="pl-1 mt-1 text-muted" style={{ fontSize: 13 }}>
Click: select series, CTRL + click: toggle multiple series
Click: select series, {navigator.platform.includes('Mac') ? 'CMD' : 'CTRL'} + click: toggle multiple series
</div>
)}
</div>