feat(Popper): made inline logic internal to Popper #8669
Merged
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.
What: Closes #8673
Changes needed from the current PRs:
inputGroupRef
from line 123getInlineParentElement
or revert it to the originalgetParentElement
on line 201 (depends if we find it necessary anymore; if we revert it then "parent" needs to be added back to the prop types)appendTo
is passed a value; if we revert line 201 then this line can also be reverted, otherwise we can just make itappendTo={appendTo}
innerRef
on line 250appendTo
from line 121<li>
element will require investigating how popper-core sets thetransform: translate
property.appendTo = "inline"
appendTo
prop from the examplesOriginal comment explaining the motivation
Essentially makes the logic for "inline" popper internal to Popper itself, rather than the components using Popper (Tooltip, Popover, Date Picker, etc) needing to house that logic (sometimes in different ways). For the most part this would only require another component to pass
appendTo="inline"
to Popper rather than needing to use a ref or call a function to determine it.Using Popover as an example, the markup from this setup looks like this (using the
children
prop):Or like this (using
reference
, though the resulting markup would depend if there's any other content between the trigger and the<Popover>
):I did try a slightly different setup locally, where if
appendTo === "inline"
then thepopper
contents would render inside of the trigger's wrapper<div style="display: contents"...
, so might depend if anyone has a preference. The markup from this other approach ended up like this using thechildren
prop on Popover:The Nav Flyout would be an outlier in that it either would need the logic implemented in #8628, or moving the flyout menu inside of the
<li>
within NavItem (doing this would require looking into how thetransform: translate
styling is applied to Popper via computedStyles in popper-core).Additional issues: