Skip to content

Commit

Permalink
A11ybug (#61)
Browse files Browse the repository at this point in the history
* small fix

* added aria-describedby property

* small fix

* prettified ActionButton

* update fix

* small fix

* bumped contact card version
  • Loading branch information
Harikarall authored Mar 9, 2023
1 parent 7b97c13 commit 38e6b8f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "office-contact-card",
"version": "2.3.2",
"version": "2.3.3",
"description": "Contact Card in MS Office style",
"repository": {
"type": "git",
Expand Down
9 changes: 7 additions & 2 deletions src/contactCard/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ function renderContactSummary(profile: IPersonaProfile, onContactDetailsClick: (
<span>{profile.officeLocation}</span>
<span>&nbsp;{profile.city}</span>
</div>
<ActionButton className="more-details contact-details" onClick={() => handleContactDetailsClick(onContactDetailsClick)} aria-label={isExpanded ? 'show more button expanded' : 'show more button collapsed'} data-focus="button" aria-live="polite">
{isExpanded ? "expanded" : "collapsed"}
<ActionButton
className="more-details contact-details"
onClick={() => handleContactDetailsClick(onContactDetailsClick)}
aria-label={isExpanded ? "show more button expanded" : "show more"}
data-focus="button"
aria-live="polite"
>
Show more
</ActionButton>
</li>
Expand Down
9 changes: 3 additions & 6 deletions src/contactCard/__snapshots__/Summary.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@ exports[`renders Summary w/o any manager 1`] = `
</span>
</div>
<CustomizedActionButton
aria-label="show more button collapsed"
aria-label="show more"
aria-live="polite"
className="more-details contact-details"
data-focus="button"
onClick={[Function]}
>
collapsed
Show more
</CustomizedActionButton>
</li>
Expand Down Expand Up @@ -152,13 +151,12 @@ exports[`renders Summary with loading manager 1`] = `
</span>
</div>
<CustomizedActionButton
aria-label="show more button collapsed"
aria-label="show more"
aria-live="polite"
className="more-details contact-details"
data-focus="button"
onClick={[Function]}
>
collapsed
Show more
</CustomizedActionButton>
</li>
Expand Down Expand Up @@ -271,13 +269,12 @@ exports[`renders full Summary 1`] = `
</span>
</div>
<CustomizedActionButton
aria-label="show more button collapsed"
aria-label="show more"
aria-live="polite"
className="more-details contact-details"
data-focus="button"
onClick={[Function]}
>
collapsed
Show more
</CustomizedActionButton>
</li>
Expand Down

0 comments on commit 38e6b8f

Please sign in to comment.