Skip to content

Commit ea316c0

Browse files
riddhybansalheloiselui
authored andcommitted
fix: tabtip fallbackplacement (carbon-design-system#19247)
1 parent 6418ff7 commit ea316c0

File tree

1 file changed

+33
-29
lines changed
  • packages/react/src/components/Popover

1 file changed

+33
-29
lines changed

packages/react/src/components/Popover/index.tsx

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -277,35 +277,39 @@ export const Popover: PopoverComponent & {
277277
),
278278
autoAlign &&
279279
flip({
280-
fallbackPlacements: align.includes('bottom')
281-
? [
282-
'bottom',
283-
'bottom-start',
284-
'bottom-end',
285-
'right',
286-
'right-start',
287-
'right-end',
288-
'left',
289-
'left-start',
290-
'left-end',
291-
'top',
292-
'top-start',
293-
'top-end',
294-
]
295-
: [
296-
'top',
297-
'top-start',
298-
'top-end',
299-
'left',
300-
'left-start',
301-
'left-end',
302-
'right',
303-
'right-start',
304-
'right-end',
305-
'bottom',
306-
'bottom-start',
307-
'bottom-end',
308-
],
280+
fallbackPlacements: isTabTip
281+
? align.includes('bottom')
282+
? ['bottom-start', 'bottom-end', 'top-start', 'top-end']
283+
: ['top-start', 'top-end', 'bottom-start', 'bottom-end']
284+
: align.includes('bottom')
285+
? [
286+
'bottom',
287+
'bottom-start',
288+
'bottom-end',
289+
'right',
290+
'right-start',
291+
'right-end',
292+
'left',
293+
'left-start',
294+
'left-end',
295+
'top',
296+
'top-start',
297+
'top-end',
298+
]
299+
: [
300+
'top',
301+
'top-start',
302+
'top-end',
303+
'left',
304+
'left-start',
305+
'left-end',
306+
'right',
307+
'right-start',
308+
'right-end',
309+
'bottom',
310+
'bottom-start',
311+
'bottom-end',
312+
],
309313

310314
fallbackStrategy: 'initialPlacement',
311315
fallbackAxisSideDirection: 'start',

0 commit comments

Comments
 (0)