Skip to content

Commit d07bc9b

Browse files
feat: imperative mode place option
1 parent 5b64278 commit d07bc9b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/Tooltip/Tooltip.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ const Tooltip = ({
239239
},
240240
} as Element
241241
computeTooltipPosition({
242-
place,
242+
place: imperativeOptions?.place ?? place,
243243
offset,
244244
elementReference: virtualElement,
245245
tooltipReference: tooltipRef.current,
@@ -328,7 +328,7 @@ const Tooltip = ({
328328
}
329329

330330
computeTooltipPosition({
331-
place,
331+
place: imperativeOptions?.place ?? place,
332332
offset,
333333
elementReference: activeAnchor,
334334
tooltipReference: tooltipRef.current,
@@ -355,6 +355,7 @@ const Tooltip = ({
355355
content,
356356
externalStyles,
357357
place,
358+
imperativeOptions?.place,
358359
offset,
359360
positionStrategy,
360361
position,

src/components/Tooltip/TooltipTypes.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export interface IPosition {
5252
export interface TooltipImperativeOpenOptions {
5353
anchorSelect?: string
5454
position?: IPosition
55+
place?: PlacesType
5556
content?: ChildrenType
5657
}
5758

0 commit comments

Comments
 (0)