diff --git a/src/core/chart-api/chart-extra-pointer.tsx b/src/core/chart-api/chart-extra-pointer.tsx index 305f3e12..c80d2f55 100644 --- a/src/core/chart-api/chart-extra-pointer.tsx +++ b/src/core/chart-api/chart-extra-pointer.tsx @@ -186,15 +186,9 @@ export class ChartExtraPointer { private applyCursorStyle = () => { const container = this.context.chart().container; - const setCursor = (value: "pointer" | "default") => { - if (container && container.style.cursor !== value) { - container.style.cursor = value; - } - }; - if (this.hoveredPoint || this.hoveredGroup) { - setCursor("pointer"); - } else { - setCursor("default"); + if (container) { + const value = this.hoveredPoint || this.hoveredGroup ? "pointer" : "default"; + container.style.cursor = value; } }; } diff --git a/src/core/chart-api/chart-extra-tooltip.tsx b/src/core/chart-api/chart-extra-tooltip.tsx index 97dd654a..83e45c54 100644 --- a/src/core/chart-api/chart-extra-tooltip.tsx +++ b/src/core/chart-api/chart-extra-tooltip.tsx @@ -168,7 +168,7 @@ export class ChartExtraTooltip extends AsyncStore { }; private get commonTrackAttrs() { - return { fill: "transparent", zIndex: -1, style: "pointer-events:none", direction: this.direction }; + return { fill: "transparent", zIndex: -1, "pointer-events": "none", direction: this.direction }; } // We compute the direction from the chart container and then explicitly set it to the track diff --git a/src/internal/chart-styles.ts b/src/internal/chart-styles.ts index 38549a41..ce031254 100644 --- a/src/internal/chart-styles.ts +++ b/src/internal/chart-styles.ts @@ -148,7 +148,7 @@ export const navigationFocusOutline = { export const cursorLine = { fill: colorChartsLineTick, zIndex: 5, - style: "pointer-events: none", + "pointer-events": "none", }; export const focusOutlineOffsets = { diff --git a/src/internal/components/series-marker/render-marker.tsx b/src/internal/components/series-marker/render-marker.tsx index bb7d7799..2eb95f44 100644 --- a/src/internal/components/series-marker/render-marker.tsx +++ b/src/internal/components/series-marker/render-marker.tsx @@ -80,7 +80,7 @@ function getDefaultPointProps(point: Highcharts.Point, selected: boolean, classN const pointStyle: Highcharts.SVGAttributes = { zIndex: selected ? 6 : 5, opacity: 1, - style: "pointer-events: none", + "pointer-events": "none", class: className, "stroke-width": 2, stroke: selected ? colorTextBodyDefault : point.color, @@ -92,7 +92,7 @@ function getDefaultPointProps(point: Highcharts.Point, selected: boolean, classN stroke: point.color, fill: "transparent", opacity: 0.4, - style: "pointer-events: none", + "pointer-events": "none", r: 8, }; return { size, pointStyle, haloStyle };