Skip to content

Bootstrap 5.2 - popover doesn't include the proper placement class #36420

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

Closed
3 tasks done
blaskognia opened this issue May 22, 2022 · 6 comments
Closed
3 tasks done

Bootstrap 5.2 - popover doesn't include the proper placement class #36420

blaskognia opened this issue May 22, 2022 · 6 comments
Labels
js stale Closed as stale v5

Comments

@blaskognia
Copy link

Prerequisites

Describe the issue

When I use the JS code with parameter PLACEMENT, popover should use placement that i declare. Thats not happend. Bootstrap popover still use AUTO.

Reduced test cases

In Bootstrap 5.1.3 work fine - this is new bug.

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

5.2

@mdo
Copy link
Member

mdo commented May 22, 2022

Bug reports must include a live demo of the issue. Per our contributing guidelines, please create a reduced test case via CodePen or JS Bin and report back with your link, Bootstrap version, and specific browser and operating system details.


This is a saved reply.

@blaskognia
Copy link
Author

blaskognia commented May 22, 2022

Live copy is here: https://codepen.io/szymon-koronkiewicz/pen/zYRdpPK

Click on test text. Popover will show. Then check source (right click on popover - option CHECK ELEMENT). Popover should have class bs-popover-bottom, but have class bs-popover-auto.

As I said before, in 5.1.3 version of bootstrap this works fine.

@mdo
Copy link
Member

mdo commented May 22, 2022

/cc @GeoSot

@Supportic
Copy link

Supportic commented May 30, 2022

If popper.js has not enough space for the popover, it will fallback to any case which is feasable in the current situation.
It considers first your fallbacks in options but if even those are not possible it will choose automatically.

Set the following css:

body{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

and adjust js, then it should work

var options = {
  placement: "right", // here
  fallbackPlacements: ["bottom"],
  html: true,
  content: "test text"
};
$(document).ready(function () {
  new bootstrap.Popover($(".testpopover"), options)
});

@blaskognia
Copy link
Author

If popper.js has not enough space for the popover, it will fallback to any case which is feasable in the current situation. It considers first your fallbacks in options but if even those are not possible it will choose automatically.

Set the following css:

body{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

and adjust js, then it should work

var options = {
  placement: "right", // here
  fallbackPlacements: ["bottom"],
  html: true,
  content: "test text"
};
$(document).ready(function () {
  new bootstrap.Popover($(".testpopover"), options)
});

This is not a problem. Problem is that class name should change.

@GeoSot
Copy link
Member

GeoSot commented Jun 8, 2022

This is not a problem. Problem is that class name should change.

Hello @blaskognia , can you provide me a link in bootstrap docs which verifies the above statement?

Just for note, I've changed the issue title as it was misleading

@GeoSot GeoSot changed the title Bootstrap 5.2 - popover ignore PLACEMENT Bootstrap 5.2 - popover doesn't include the proper placement class Jun 8, 2022
@mdo mdo added the stale Closed as stale label Apr 10, 2025
@mdo mdo closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
js stale Closed as stale v5
Projects
None yet
Development

No branches or pull requests

4 participants