Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
updated as per review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AH106586Harika authored and AH106586Harika committed Oct 26, 2023
1 parent f8779db commit 7cb2fd3
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 17 deletions.
7 changes: 0 additions & 7 deletions packages/terra-dropdown-button/src/DropdownButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ class DropdownButton extends React.Component {

const dropDownMenuId = uuidv4();
const dropDownMenuListId = `dropdown-menu-list-${dropDownMenuId}`;
let dropDownMenuButtonId = `dropdown-menu-button-${dropDownMenuId}`;
if (modifiedButtonAttrs && modifiedButtonAttrs.id) {
dropDownMenuButtonId = modifiedButtonAttrs.id;
delete modifiedButtonAttrs.id;
}

return (
<DropdownButtonBase
Expand All @@ -208,7 +203,6 @@ class DropdownButton extends React.Component {
buttonRef={this.getButtonNode}
getSelectedOptionText={this.getSelectedOptionText}
menuId={dropDownMenuListId}
buttonId={dropDownMenuButtonId}
>
<button
{...modifiedButtonAttrs}
Expand All @@ -224,7 +218,6 @@ class DropdownButton extends React.Component {
aria-expanded={isOpen}
aria-label={buttonAriaLabel}
aria-haspopup="true"
id={dropDownMenuButtonId}
aria-controls={dropDownMenuListId}
onBlur={this.handleBlur}
>
Expand Down
3 changes: 1 addition & 2 deletions packages/terra-dropdown-button/src/_Dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Dropdown = ({
requestClose, isOpen, targetRef, children, width, refCallback, buttonRef, getSelectedOptionText, ...customProps
}) => {
const buttonFocused = useRef(false);
const { menuId, buttonId } = customProps;
const { menuId } = customProps;
useEffect(() => {
// added this change to bring focus back to button when dropdown list is closed.
if (buttonFocused.current && buttonRef) {
Expand Down Expand Up @@ -78,7 +78,6 @@ const Dropdown = ({
refCallback={refCallback}
getSelectedOptionText={getSelectedOptionText}
menuId={menuId}
buttonId={buttonId}
>
{children}
</DropdownList>
Expand Down
1 change: 0 additions & 1 deletion packages/terra-dropdown-button/src/_DropdownButtonBase.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ class DropdownButtonBase extends React.Component {
refCallback={refCallback}
getSelectedOptionText={getSelectedOptionText}
menuId={customProps.menuId}
buttonId={customProps.buttonId}
>
{items}
</Dropdown>
Expand Down
1 change: 0 additions & 1 deletion packages/terra-dropdown-button/src/_DropdownList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ class DropdownList extends React.Component {
onKeyUp={this.handleKeyUp}
role="menu"
id={customProps.menuId}
aria-labelledby={customProps.buttonId}
>
{this.cloneChildren()}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ describe('Dropdown Button', () => {
</DropdownButton>
</ThemeContextProvider>,
);
const dropDownButtonId = wrapper.find('#dropDown');
expect(dropDownButtonId.exists()).toBe(true);
expect(wrapper).toMatchSnapshot();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ exports[`Dropdown Button correctly applies the theme context className 1`] = `
variant="neutral"
>
<DropdownButtonBase
buttonId="dropdown-menu-button-00000000-0000-0000-0000-000000000000"
buttonRef={[Function]}
getSelectedOptionText={[Function]}
id="dropDown"
Expand All @@ -95,7 +94,6 @@ exports[`Dropdown Button correctly applies the theme context className 1`] = `
requestClose={[Function]}
>
<div
buttonId="dropdown-menu-button-00000000-0000-0000-0000-000000000000"
className="dropdown-button-base orion-fusion-theme"
id="dropDown"
menuId="dropdown-menu-list-00000000-0000-0000-0000-000000000000"
Expand All @@ -108,7 +106,6 @@ exports[`Dropdown Button correctly applies the theme context className 1`] = `
aria-label="Primary Option"
className="dropdown-button neutral orion-fusion-theme"
disabled={false}
id="dropdown-menu-button-00000000-0000-0000-0000-000000000000"
onBlur={[Function]}
onClick={[Function]}
onKeyDown={[Function]}
Expand All @@ -125,7 +122,6 @@ exports[`Dropdown Button correctly applies the theme context className 1`] = `
/>
</button>
<Dropdown
buttonId="dropdown-menu-button-00000000-0000-0000-0000-000000000000"
buttonRef={[Function]}
getSelectedOptionText={[Function]}
isOpen={false}
Expand Down

0 comments on commit 7cb2fd3

Please sign in to comment.