maintain proper width for popover outside the parent container

maintain proper width for popover outside the parent container

Hi. I am trying to develop a popover such as  Bootstrap popover
The thing is though the popover gets deformed as it is moved to the end of its parent container as shown in the image.

I would like to keep its proper width even if the popover appears OUTSIDE the parent.
Of course, setting css 'width' can help a bit, but it does not flexibly alter the width according to the inner text.
I would like to maintain minimum width so that the inner texts do not get forcibly go to a new line.

any idea?