You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+24-22Lines changed: 24 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,7 @@ All notable changes for each version of this project will be documented in this
13
13
### New Features
14
14
15
15
-`IgxOverlay`
16
-
- Position Settings now accept a new optional `placement` input property of type `Placement`. Controls where to place the element relative to the target element. Supported values are `top`, `top-start`, `top-end`, `bottom`, `bottom-start`, `bottom-end`, `right`, `right-start`, `right-end`, `left`, `left-start`, `left-end`.
17
-
18
-
_Note:_`horizontalDirection`, `horizontalStartPoint`, `verticalDirection`, and `verticalStartPoint` has priority.
19
-
20
-
- Position Settings now accept a new optional `offset` input property of type `number`. Used to set the offset of the element from the target in pixels when shown in connected, elastic, or auto position strategy.
16
+
- Position Settings now accept a new optional `offset` input property of type `number`. Used to set the offset of the element from the target in pixels.
21
17
22
18
-`IgxTooltip`
23
19
- The tooltip now remains open while interacting with it.
@@ -36,32 +32,39 @@ All notable changes for each version of this project will be documented in this
36
32
37
33
- Introduced a new `hasArrow` input property. Controls whether to display an arrow indicator for the tooltip. Defaults to `false`.
38
34
39
-
_Note:_ The arrow's position takes `positionSettings.placement` property into account. If `hasArrow` is set to `true`, changing the `placement` property will change the arrow position as well.
<span#tooltipRef="tooltip"igxTooltip>Hello there, I am a tooltip!</span>
43
-
```
44
-
```ts
45
-
public settings: PositionSettings = {
46
-
placement: Placement.TopStart
47
-
}
48
-
```
35
+
_Note:_ The tooltip uses the `TooltipPositionStrategy` to position the tooltip and arrow element. If a custom position strategy is used (`overlaySettings.positionStrategy`) and `hasArrow` is set to `true`, the custom strategy should extend the `TooltipPositionStrategy`. Otherwise, the arrow will not be displayed.
36
+
37
+
_Note:_ The arrow element is positioned based on the provided position settings. If the directions and starting points do not correspond to any of the predefined position values, the arrow is positioned in the top middle side of the tooltip (default tooltip position `bottom`).
38
+
39
+
40
+
| Position | Horizontal Direction | Horizontal Start Point | Vertical Direction | Vertical Start Point |
_Note:_ The tooltip uses the `TooltipPositionStrategy` to position the tooltip and arrow element. If a custom position strategy is used (`overlaySettings.positionStrategy`) and `hasArrow` is set to `true`, the custom strategy should implement the `ITooltipPositionStrategy` interface that exposes the `positionArrow(arrow: HTMLElement, arrowFit: ArrowFit)` method. Otherwise, the arrow will not be displayed.
51
56
52
-
_Note:_ The arrow element is positioned based on the `positionSettings.placement` property. If `horizontalDirection`, `horizontalStartPoint`, `verticalDirection`, and `verticalStartPoint` are used and the direction and starting point do not correspond to any of the predefined placement values, the arrow is positioned based on `Placement.Bottom` (top middle side of the tooltip).
53
-
54
-
The arrow can be positioned via a custom position strategy that implements the `positionArrow(arrow: HTMLElement, arrowFit: ArrowFit)` method.
57
+
The arrow's position can be customized by overriding the `positionArrow(arrow: HTMLElement, arrowFit: ArrowFit)` method.
55
58
56
59
For example:
57
60
58
61
```ts
59
-
export class CustomStrategy extends ConnectedPositioningStrategy implements ITooltipPositionStrategy {
62
+
export class CustomStrategy extends TooltipPositioningStrategy {
60
63
constructor(settings?: PositionSettings) {
61
64
super(settings);
62
65
}
63
66
64
-
public positionArrow(arrow: HTMLElement, arrowFit: ArrowFit): void {
67
+
public override positionArrow(arrow: HTMLElement, arrowFit: ArrowFit): void {
65
68
Object.assign(arrow.style, {
66
69
left: '-0.25rem',
67
70
transform: 'rotate(-45deg)',
@@ -72,7 +75,6 @@ All notable changes for each version of this project will be documented in this
0 commit comments