Skip to content

Commit

Permalink
Improve docs for Slider outputFunction (#2674)
Browse files Browse the repository at this point in the history
I spent a bit of time on finding this option, as it was not clear to me that the `outputFunction` processes the current value for display text.

I added a suggested change, but feel free to change it 👍
  • Loading branch information
Strepto authored Nov 25, 2022
1 parent 8872904 commit 89bd66b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/eds-core-react/src/components/Slider/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ export type SliderProps = {
event: MouseEvent | KeyboardEvent,
newValue: number[] | number,
) => void
/** Function for formatting the output, e.g. with dates */
outputFunction?: (text: number) => string
/** Function for formatting the displayed value. E.g. formatting dates, or adding a unit suffix */
outputFunction?: (value: number) => string
/** Max value */
max?: number
/** Min value */
Expand Down

0 comments on commit 89bd66b

Please sign in to comment.