@@ -415,12 +415,18 @@ export default function Popover({
415
415
< div
416
416
className = { classnames (
417
417
'absolute z-5' ,
418
+ variant === 'panel' && [
419
+ 'max-h-80 ' ,
420
+ 'rounded border bg-white shadow hover:shadow-md focus-within:shadow-md' ,
421
+ ! arrow && 'overflow-y-auto overflow-x-hidden' ,
422
+ ] ,
423
+ arrow && 'overflow-visible' ,
418
424
asNativePopover && [
419
425
// We don't want the popover to ever render outside the viewport,
420
426
// and we give it a 16px gap
421
427
'max-w-[calc(100%-16px)]' ,
422
428
// Overwrite [popover] default styles
423
- 'p-0 m-0 overflow-visible ' ,
429
+ 'p-0 m-0' ,
424
430
] ,
425
431
! asNativePopover && {
426
432
// Hiding instead of unmounting so that popover size can be computed
@@ -429,6 +435,7 @@ export default function Popover({
429
435
'right-0' : align === 'right' ,
430
436
'min-w-full' : true ,
431
437
} ,
438
+ classes ,
432
439
) }
433
440
ref = { downcastRef ( popoverRef ) }
434
441
popover = { asNativePopover && 'auto' }
@@ -439,8 +446,8 @@ export default function Popover({
439
446
{ open && arrow && (
440
447
< div
441
448
className = { classnames ( 'absolute z-10' , 'fill-white text-grey-3' , {
442
- 'top-[calc(100%-1px)] ' : resolvedPlacement === 'above' ,
443
- 'bottom-[calc(100%-1px)] ' : resolvedPlacement === 'below' ,
449
+ 'top-full ' : resolvedPlacement === 'above' ,
450
+ 'bottom-full ' : resolvedPlacement === 'below' ,
444
451
'left-2' : align === 'left' ,
445
452
'right-2' : align === 'right' ,
446
453
} ) }
@@ -453,20 +460,7 @@ export default function Popover({
453
460
) }
454
461
</ div >
455
462
) }
456
- { open && (
457
- < div
458
- className = { classnames (
459
- variant === 'panel' && [
460
- 'max-h-80 overflow-y-auto overflow-x-hidden' ,
461
- 'rounded border bg-white shadow hover:shadow-md focus-within:shadow-md' ,
462
- ] ,
463
- classes ,
464
- ) }
465
- data-testid = "popover-content"
466
- >
467
- { children }
468
- </ div >
469
- ) }
463
+ { open && children }
470
464
</ div >
471
465
) ;
472
466
}
0 commit comments