I want to reposition the popover - which is currently to the right of the Circle SVG - based on either the user's mouse position within the CircleSVG (on click) or move it to the exact the center of the SVG (moving both the popover content and arrow). Is it possible to change it dynamically?
const popover = new bootstrap.Popover(document.getElementById("test"), {
html: true,
sanitize: false,
trigger: 'manual',
content: 'Nice'
});
function togglePopover() {
popover.toggle();
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script>
<svg onclick="togglePopover()" height="100" width="100">
<circle id="test" cx="50" cy="50" r="40" stroke="black" stroke width="3" fill="red" />
</svg>