Closed starpit closed 1 year ago
Will be addressed by this issue - https://github.com/patternfly/patternfly-react/issues/8666
reference could be renamed to triggerRef. popperRef is not exposed to other components that use Popper.
If we want users to utilize the alternate strict mode warning resolution (passing references and avoiding the wrapping div), then we should make sure components that use Popper have these props available and support them (as the trigger would have be rendered on the component side rather than passed to Popper).
@mcoker Would a span
cause less issues overall as far as DOM nesting? The wrapping element is only there to contain the Popper references it requires.
I will still be updating Popper consuming components to allow them to utilize the other strict-mode enabling method which requires refs.
span should be fine. i think the only restriction is <p>
under <p>
Sorry I could be off base, but does this wrap the popper contents? If so, it's worth noting only phrasing content can be placed inside of a <span>
- would adding a list or div or some non-phrasing element potentially throw a validateDomNesting
warning in popper's <span>
, too?
The wrapping elements wrap the trigger and the popper. We could leave the popper wrapper as div
and only update the trigger to span
maybe.
Describe the problem When
removeFindDomNode
is enabled on<Tooltip>
, avalidateDomNesting
warning can result. If the tooltipped element is nested in a<p>
, then Tooltip's use of<div>
as the Popper-wrapper causes this warning.This only occurs when
removeFindDomNode
is supplied, due to https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/helpers/Popper/Popper.tsx#L411Since this comes from the generic Popper helper, this probably affects other components, beyond Tooltip.
How do you reproduce the problem? Wrap a Tooltip'd element in a
<p>
, and provideremoveFindDomNode
to the<Tooltip>
.Expected behavior The Popper wrapper should work in any nesting.
Is this issue blocking you? The workaround is to avoid React StrictMode.
Screenshots n/a
What is your environment?
What is your product and what release date are you targeting? Kui
Any other information?