79785368

Date: 2025-10-08 10:52:29
Score: 0.5
Natty:
Report link

Ok, I found the problem, is about how the popover api positions the element by default on the center of the viewport using margins and insets.

I've solved it reseting the second popover:

#first-popover {
  width: 300px;
}
#second-popover:popover-open {
  margin: 0;
  inset: auto;
}
#second-popover {
  position-area: top;
}
<button id="open-1" popovertarget="first-popover">Open first popover</button>

<div id="first-popover" popover>
   <button id="open-2" popovertarget="second-popover">Open second popover</button>
</div>

<div id="second-popover" popover="manual">Hello world</div>

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Gustavo Rodriguez Coronas