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

Commit

Permalink
added aria-pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Sugan G authored and Sugan G committed Oct 17, 2023
1 parent 0270db2 commit 6ecd187
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ exports[`correctly applies the theme context className 1`] = `
>
<button
aria-disabled={false}
aria-pressed={false}
className="button neutral orion-fusion-theme button-group-button orion-fusion-theme"
data-terra-button-group-button={true}
disabled={false}
Expand Down Expand Up @@ -101,7 +100,6 @@ exports[`correctly applies the theme context className 1`] = `
>
<button
aria-disabled={false}
aria-pressed={false}
className="button neutral orion-fusion-theme button-group-button orion-fusion-theme"
data-terra-button-group-button={true}
disabled={false}
Expand Down
4 changes: 1 addition & 3 deletions packages/terra-button/src/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,6 @@ class Button extends React.Component {
if (href) {
ComponentType = 'a';
customProps.role = 'button';
} else if (isSelectable) {
customProps.role = 'checkbox';
}

return (
Expand All @@ -352,7 +350,7 @@ class Button extends React.Component {
onFocus={this.handleFocus}
href={href}
ref={refCallback}
aria-checked={isSelectable ? this.state.isSelected : undefined}
aria-pressed={isSelectable ? this.state.isSelected : undefined}
>
{buttonLabel}
</ComponentType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ exports[`should render a neutral button 1`] = `

exports[`should render a selectable button 1`] = `
<button
aria-checked={false}
aria-disabled={false}
aria-pressed={false}
className="button neutral"
disabled={false}
onBlur={[Function]}
Expand All @@ -381,7 +381,6 @@ exports[`should render a selectable button 1`] = `
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
role="checkbox"
type="button"
>
<span
Expand Down

0 comments on commit 6ecd187

Please sign in to comment.