rubenv / angular-rt-popup

A better version of the Bootstrap popover, for Angular.JS
MIT License
22 stars 14 forks source link

Location of popup when first displayed #9

Closed cdjackson closed 9 years ago

cdjackson commented 9 years ago

I often see that the popup is not positioned correctly when it's first displayed. Currently I'm using 'left' positioning and I find that the first time it's displayed it scrolls off the right side of the screen.

What I think is happening is that the element size isn't know as it's not rendered fully (this may only be if there's dynamic content). So, if the element size isn't known, we fix the left position based on incorrect information, and it's wrongly positioned.

I think that if we're using left positioning, then we should set the position using css:right so that the popup expands to the left. The same is presumably true of top positioning where we should use css:bottom to allow the window to expand up?

cdjackson commented 9 years ago

This can be closed following the merge of #10 . Thanks.