-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(popover)(tooltip): "auto" position is not working correctly #2796
Comments
I deployed the demo to now.sh (https://ngx-bootstrap-issue-demo-smunotreuo.now.sh/) for examination. Strangely, I was able to recreate both issues locally, but the deployed version behaves a little differently and Bug 1 (going off the top of the screen by ~100 pixels) does not appear to happen anymore. Update: It seems that the bug depends on window resolution. Bug 1 occurs in the deployed version if the the resolution is 1280x800, but not 1440x900. This was tested using the Chrome Developer Tools. |
Thanks for demo! We will be reworking auto positioning from zero, cuz now it's more experimental and works only for static use cases |
You're welcome and thank you so much for your response! I think we can just use a small modal in our use case. Good luck with the auto positioning rework. |
I will need some luck, positioning is a hell |
Is this issue actively being worked on or has it been tabled? |
V2 is stable and we are fixing mostly datepicker and build issue before releasing it |
Any updates on this? Hitting this issue too. |
Add a parent div element with the class property of 'position-relative' and it will solve your problem |
@aldus25 Could you please be little more specific - which element should be wrapped inside a parent div (the trigger control or the popover)? |
Any ETA on this issue? we are still facing this issue. |
Add a parent div element with the class property of 'position-relative' and it will solve your problem |
@aldus25 can you please give me any demo link kinda. really not sure when you say wrapping over a relatively positioned div. very much appreciated. |
The tooltip auto is absolute positioned, so if it doesnt find a relative positioned parent it will use the window, body or any tag available. You need to wrap the tooltip with any tag but this tag has to have a position: relative css style. For more details on positioning please refer to: https://learn.shayhowe.com/advanced-html-css/detailed-css-positioning/ |
Any updates ? Found out that Would you like a PR ? As @valorkin said, positioning is a hell of a problem. Bootstrap uses a great 3rd party library, (popper.js), why don't you use it as well in this project ? Is this only to avoid additional dependencies ? |
Any solution for this? I have several tooltips implemented with this project but whe the element is near of a corner the tooltip get cut a little. It's obviously about positioning. |
like @Waowam i think you should use popper.js |
I need to do a left or right display of a popover depending of the room but i cant use Any solution or plan for fixing this bug ? |
We will be happy to have this fix as well !!! |
Any updates on this |
Hello everyone! This issue fixed in version 3.3.0. Positioning service fully rewrote: https://github.com/valor-software/ngx-bootstrap/blob/development/CHANGELOG.md |
Fixed in #5027 |
Feature
"auto"
positioning in the[popover]
directive. This could be related to issue #2661, but I'm not sure.Bugs
"bottom"
position."top"
position.Context
version:
1.9.3
The application is a dashboard with draggable tiles, each having a popover in the top right corner.
This is the current configuration for the popover:
[popover]="popoverTemplate"
placement="auto"
container="body"
(several parent elements haveoverflow: hidden
)[outsideClick]="true"
I have created a simplified demo here: https://github.com/nfiles/ngx-bootstrap-popover-issue-demo
Misc
I wasn't sure where to go next in my debugging, so I started to look at the source. In
src/positioning/ng-positioning.ts
at line 197 I noticed that if the"top"
and"bottom"
else-if blocks were switched, everything worked as expected. I assume this is because"top"
is preferred over"bottom"
, but I do not know why the"top"
position is chosen when the popover is going off screen.The text was updated successfully, but these errors were encountered: