How to keep Bootstrap 4 dropdowns in the viewport
How to keep Bootstrap 4 dropdowns in the viewport
george.levines
Posts: 11Questions: 4Answers: 0
Is there a way to keep Bootstrap 4 buttons from spilling out of the viewport? Even the ones in the example seem to do it but in BS4's documentation, button menus automagically stay in view.
This discussion has been closed.
Answers
Hi @george.levines ,
Can you give more details on what's spilling out please, and what you think it should be doing instead? That link you posted looks fine to me.
Cheers,
Colin
In other words, I would expect this menu to open to the top if the div extended beyond the viewport to the bottom.
It does do correction for the document, but it doesn't take a
div
into account. That would require parsing up the DOM and could be quite slow.Allan
So in other words, this is expected?
I guess it's just in contrast to the examples given here https://getbootstrap.com/docs/4.3/components/dropdowns/
Correct - Buttons doesn't 100% implement the Bootstrap extras there. It primarily just uses Bootstrap for styling, but because it isn't solely a Bootstrap component, it doesn't have support (yet) for all the extra classes Bootstrap makes available.
Allan