feat(Dropdown): Add optional container with ouiaId #12022
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.
Technically this is possible for consumers already - they can import the ouia helper function and create a component in their repo to wrap all PF Dropdowns with if they want to.
This PR adds an optional container with a ouiaId. The container component type can be customized via a prop as well. Container does not render if containerOuiaId is not used so as not to break existing consumers.
Advised filer of issue that he can pass prop
popperProps={{appendTo: 'inline'}}
to the Dropdown component if he wants Dropdown behavior similar to older versions of PatternFly (inline in DOM). Not addressing that here, but verified that passing that prop places both the toggle and dropdown in the container when the dropdown is open. If inline is not applied, menu will appear at Popper default location, but container will wrap toggle at least.I am not adjusting the behavior of the dropdown (removal from DOM). I think this would be a breaking change.
What: Closes #11086
Additional issues: