feat(tooltip/popover/dropdown): add custom container support #4551
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before submitting a pull request, please make sure you have at least performed the following:
Currently in ng-bootstrap, there is no way of setting the container of tooltip/popover/dropdown to other values, the only accepted values are null and
body
, which is not enough. For example, I have something likeor somthing like above, then if I need to make
#screen
div fullscreen, then all tooltip/popover/dropdown withcontainer=body
will not work, without thecontainer=body
the actual container must not beoverflow: hidden
, this is huge restriction. And my special case has much more problem, I have a something in table, the outer component also need to be fullscreen, in the cells of this table, I have dropdown as actions menu, have tooltip on some elements, and also the popover on some elements, without this custom container support, my use case will only work without the component fullscreen.So I've changed the
container
input, which accept an valid css selector or aHTMLElement
, then tooltip/popover/dropdown will use this container element as the real container. this will solve the many problems.and I don't think there will be any new test, because the
body
string value incontainer
is a valid CSS selector. so the old tests works fine.And I believe this will also fix #1884 and #870 .