Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import styles from '@patternfly/react-styles/css/components/Dropdown/dropdown';
import { css } from '@patternfly/react-styles';
import DropdownMenu from './DropdownMenu';
import { DropdownPosition, DropdownDirection, DropdownContext } from './dropdownConstants';
import { isOUIAEnvironment, getUniqueId as getOIUAUniqueId } from '../../helpers/ouia';

// seed for the aria-labelledby ID
let currentId = 0;
Expand Down Expand Up @@ -87,6 +88,7 @@ export class DropdownWithContext extends React.Component {
component = 'div';
renderedContent = children;
}
ouiaId = getOIUAUniqueId();
return (
<DropdownContext.Consumer>
{({ baseClass, baseComponent: BaseComponent }) => (
Expand All @@ -101,6 +103,10 @@ export class DropdownWithContext extends React.Component {
ref={ref => {
this.parentRef = ref;
}}
{...isOUIAEnvironment() && {
'data-ouia-component-type': 'Dropdown',
'data-ouia-component-id': this.ouiaId
}}
>
{Children.map(toggle, oneToggle =>
cloneElement(oneToggle, {
Expand Down