Skip to content

Commit b70306f

Browse files
authored
feat(tooltip): add flip and adjust distance from reference element (#807)
1 parent 5634c67 commit b70306f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/core/src/components/tooltip/tooltip.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,17 @@ export class AtomTooltip {
109109
this._popperInstance = createPopper(selector, this.el, {
110110
placement: this.placement,
111111
modifiers: [
112+
{
113+
name: 'flip',
114+
options: {
115+
fallbackPlacements: ['top', 'bottom', 'right', 'left'],
116+
},
117+
},
112118
{
113119
name: 'offset',
114120
options: {
115-
offset: [0, 4],
121+
// 4px from visible distance + 3px from arrow square range (negative value) from SCSS.
122+
offset: [0, 7],
116123
},
117124
},
118125
],

0 commit comments

Comments
 (0)