anchor.css
1[popovertarget] {
2  anchor-name: --trigger;
3}
4[popover] {
5  position-anchor: --trigger;
6  top: anchor(bottom);
7  left: unset;
8  right: anchor(right);
9  position-try-fallbacks: flip-block, flip-inline;
10}

No JavaScript necessary, aside from the dragging

Anchor Positioning
125125××