Skip to content

Commit

Permalink
fix: Do not render cursors if disabled (#290)
Browse files Browse the repository at this point in the history
* Fixed typo from docs

* Do not show cursors at all if disabled
  • Loading branch information
bonsmik authored Jul 4, 2022
1 parent a08e7c9 commit 7c71ed4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/src/pages/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ If you'd like to have a custom height and width in the client side you may have

`getSeriesOrder` expect a function, this option will allows you to reorder the series if you want.

`primaryCursor` and `secundaryCursor` take the options that configure the line/rectangle that is drawn underneath your cursor when you hover over the chart. When both are used, it produces a kind of cross-hair. Both are set to true by default.
`primaryCursor` and `secondaryCursor` take the options that configure the line/rectangle that is drawn underneath your cursor when you hover over the chart. When both are used, it produces a kind of cross-hair. Both are set to true by default.

## Axes

Expand Down Expand Up @@ -306,7 +306,7 @@ const secondaryAxes = React.useMemo(

**getSeriesOrder** expect a function, this option will allows you to reorder the series if you want.

**primaryCursor** and **secundaryCursor** take the options that configure the line/rectangle that is drawn underneath your cursor when you hover over the chart. When both are used, it produces a kind of cross-hair. Both are set to true by default.
**primaryCursor** and **secondaryCursor** take the options that configure the line/rectangle that is drawn underneath your cursor when you hover over the chart. When both are used, it produces a kind of cross-hair. Both are set to true by default.

### Curve Types

Expand Down
4 changes: 2 additions & 2 deletions src/components/Cursors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export default function Cursors<TDatum>() {

return (
<>
<Cursor primary options={resolvedPrimaryOptions} />
<Cursor options={resolvedSecondaryOptions} />
{resolvedPrimaryOptions.show && <Cursor primary options={resolvedPrimaryOptions} />}
{resolvedSecondaryOptions.show && <Cursor options={resolvedSecondaryOptions} />}
</>
)
}
Expand Down

0 comments on commit 7c71ed4

Please sign in to comment.