Skip to content

Commit 4e09c8d

Browse files
committed
fix documentation
1 parent 3673fdf commit 4e09c8d

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ Whether to close the tooltip when it's trigger is out of the boundary.
241241
242242
Whether to use `React.createPortal` for creating tooltip.
243243

244+
### portalContainer
245+
246+
> `HTMLElement` | defaults to `document.body`
247+
248+
Element to be used as portal container
249+
244250
### modifiers
245251

246252
> `object`

typings/react-popper-tooltip.d.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ declare module 'react-popper-tooltip' {
7272
tooltip: (props: TooltipProps) => JSX.Element;
7373
/** The trigger child. */
7474
children: (props: ChildProps) => JSX.Element;
75+
/**
76+
* The tooltip placement.
77+
* @see https://popper.js.org/popper-documentation.html#Popper.placements
78+
*/
79+
placement?: Popper.Placement;
7580
/** The initial visibility state of the tooltip. */
7681
defaultTooltipShown?: boolean;
7782
/**
@@ -84,7 +89,8 @@ declare module 'react-popper-tooltip' {
8489
* redux, react-router, or anywhere else. */
8590
tooltipShown?: boolean;
8691
/** Called when the visibility of the tooltip changes.
87-
* `tooltipShown` is a new state. */
92+
* `tooltipShown` is the new state.
93+
*/
8894
onVisibilityChange: (tooltipShown: boolean) => void;
8995
/** Delay in showing the tooltip (ms). Defaults to 0. */
9096
delayShow?: number;
@@ -95,14 +101,21 @@ declare module 'react-popper-tooltip' {
95101
* Defaults to hover.
96102
*/
97103
trigger?: 'click' | 'hover' | 'right-click' | 'none';
98-
/** Whether to close the tooltip when it's trigger is out of the boundary.
104+
/**
105+
* Whether to close the tooltip when it's trigger is out of the boundary.
99106
* Defaults to true.
100107
*/
101108
closeOnOutOfBoundaries?: boolean;
102-
/** Whether to use React.createPortal for creating tooltip.
109+
/**
110+
* Whether to use React.createPortal for creating tooltip.
103111
* Defaults to true.
104112
*/
105113
usePortal?: boolean;
114+
/**
115+
* Element to be used as portal container
116+
* Defaults to document.body.
117+
*/
118+
portalContainer?: HTMLElement;
106119
/**
107120
* Modifiers passed directly to the underlying popper.js instance. For more
108121
* information, refer to Popper.js’ [modifier docs](https://popper.js.org/popper-documentation.html#modifiers).
@@ -118,11 +131,5 @@ declare module 'react-popper-tooltip' {
118131
```
119132
*/
120133
modifiers?: Popper.Modifiers;
121-
/**
122-
* The tooltip placement.
123-
*
124-
* @see https://popper.js.org/popper-documentation.html#Popper.placements
125-
*/
126-
placement?: Popper.Placement;
127134
}
128135
}

0 commit comments

Comments
 (0)