Skip to content

Commit a7e040d

Browse files
committed
docs: update docs for browsingContext props
1 parent e807bc9 commit a7e040d

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,19 @@ export const Example = () => {
6767

6868
| Prop | Type | Required | Default | Description |
6969
| ---- | ---- | :------: | ------- | ----------- |
70-
| [`boundsPadding`](https://react-compare-slider.vercel.app/?path=/story/demos--bounds-padding) | `number` | | `0` | Padding to limit the slideable bounds in pixels on the X-axis (landscape) or Y-axis (portrait). |
71-
| [`changePositionOnHover`](https://react-compare-slider.vercel.app/?path=/story/demos--change-position-on-hover) | `boolean` | | `false` | Whether the slider should follow the pointer on hover. |
72-
| [`disabled`](https://react-compare-slider.vercel.app/?path=/story/demos--disabled) | `boolean` | | `false` | Whether to disable slider movement (items are still interactable). |
73-
| [`handle`](https://react-compare-slider.vercel.app/?path=/story/demos--handle) | `ReactNode` | | `undefined` | Custom handle component. |
74-
| `itemOne` | `ReactNode` || `undefined` | First component to show in slider. |
75-
| `itemTwo` | `ReactNode` | | `undefined` | Second component to show in slider. |
76-
| [`keyboardIncrement`](https://react-compare-slider.vercel.app/?path=/story/demos--keyboard-increment) | `` number\|`${number}%` `` | | `5%` | Percentage or pixel amount to move when the slider handle is focused and keyboard arrow is pressed. |
77-
| [`onlyHandleDraggable`](https://react-compare-slider.vercel.app/?path=/story/demos--only-handle-draggable) | `boolean` | | `false` | Whether to only change position when handle is interacted with (useful for touch devices). |
78-
| [`onPositionChange`](https://react-compare-slider.vercel.app/?path=/story/demos--on-position-change) | `function` | | `undefined` | Callback on position change, returns current position percentage as argument `(position) => { ... }`. |
79-
| [`portrait`](https://react-compare-slider.vercel.app/?path=/story/demos--portrait) | `boolean` | | `false` | Whether to use portrait orientation. |
80-
| [`position`](https://react-compare-slider.vercel.app/?path=/story/demos--position) | `number` | | `50` | Initial percentage position of divide (`0-100`). |
81-
| [`transition`](https://react-compare-slider.vercel.app/?path=/story/demos--transition) | `string` | | `undefined` | Shorthand CSS `transition` property to apply to handle movement. E.g. `.5s ease-in-out` |
82-
| [`browsingContext`](https://react-compare-slider.vercel.app/?path=/story/demos--browsing-context) | `Window` | | `undefined` | Custom browsing context to use instead of the global `window` object when listening for pointer events. |
70+
| [`boundsPadding`](https://react-compare-slider.vercel.app/?path=/story/demos--bounds-padding) | `number` | | `0` | Padding to limit the slideable bounds in pixels on the X-axis (landscape) or Y-axis (portrait).
71+
| `browsingContext` | `globalThis` | | `globalThis` | Context to bind events to (useful for iframes).
72+
| [`changePositionOnHover`](https://react-compare-slider.vercel.app/?path=/story/demos--change-position-on-hover) | `boolean` | | `false` | Whether the slider should follow the pointer on hover.
73+
| [`disabled`](https://react-compare-slider.vercel.app/?path=/story/demos--disabled) | `boolean` | | `false` | Whether to disable slider movement (items are still interactable).
74+
| [`handle`](https://react-compare-slider.vercel.app/?path=/story/demos--handle) | `ReactNode` | | `undefined` | Custom handle component.
75+
| `itemOne` | `ReactNode` | ✓ | `undefined` | First component to show in slider.
76+
| `itemTwo` | `ReactNode` | ✓ | `undefined` | Second component to show in slider.
77+
| [`keyboardIncrement`](https://react-compare-slider.vercel.app/?path=/story/demos--keyboard-increment) | `` number\|`${number}%` `` | | `5%` | Percentage or pixel amount to move when the slider handle is focused and keyboard arrow is pressed.
78+
| [`onlyHandleDraggable`](https://react-compare-slider.vercel.app/?path=/story/demos--only-handle-draggable) | `boolean` | | `false` | Whether to only change position when handle is interacted with (useful for touch devices).
79+
| [`onPositionChange`](https://react-compare-slider.vercel.app/?path=/story/demos--on-position-change) | `(position: number) => void` | | `undefined` | Callback on position change, returns current position percentage as argument.
80+
| [`portrait`](https://react-compare-slider.vercel.app/?path=/story/demos--portrait) | `boolean` | | `false` | Whether to use portrait orientation.
81+
| [`position`](https://react-compare-slider.vercel.app/?path=/story/demos--position) | `number` | | `50` | Initial percentage position of divide (`0-100`).
82+
| [`transition`](https://react-compare-slider.vercel.app/?path=/story/demos--transition) | `string` | | `undefined` | Shorthand CSS `transition` property to apply to handle movement. E.g. `.5s ease-in-out`
8383

8484
[API docs](https://react-compare-slider.vercel.app/?path=/docs/docs-api--docs) for more information.
8585

lib/src/ReactCompareSlider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const ReactCompareSlider = forwardRef<
4444
(
4545
{
4646
boundsPadding = 0,
47+
browsingContext = globalThis,
4748
changePositionOnHover = false,
4849
disabled = false,
4950
handle,
@@ -56,7 +57,6 @@ export const ReactCompareSlider = forwardRef<
5657
position = 50,
5758
style,
5859
transition,
59-
browsingContext = globalThis,
6060
...props
6161
},
6262
ref,

0 commit comments

Comments
 (0)