Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react-tags-preview): add default aria-labelledby on InteractionTagSecondary #29234

Merged
merged 6 commits into from
Sep 25, 2023

Conversation

YuanboXue-Amber
Copy link
Contributor

@YuanboXue-Amber YuanboXue-Amber commented Sep 21, 2023

Fix #29219

Before this change:

User needs to set aria-labelledby on InteractionTagSecondary to make it compute accessible name that contains information from InteractionTagPrimary:

<InteractionTag>
  <InteractionTagPrimary
    id={primaryId} // 1️⃣ need id 
    hasSecondaryAction
  >
    primary
  </InteractionTagPrimary>
  <InteractionTagSecondary
    id={secondaryId} // 2️⃣ need id 
    aria-label="remove" // 3️⃣ need aria-label 
    aria-labelledby={`${primaryId} ${secondaryId}`} // 4️⃣ need aria-labelledby to compute accessible name "primary remove"
  />
</InteractionTag>;

After this change:

InteractionTag creates id for InteractionTagPrimary, and pass it thru context. InteractionTagSecondary now has default aria-labelledby=`${primaryId} ${secondaryId}`. And user only needs to set a short aria-label:

<InteractionTag>
  <InteractionTagPrimary hasSecondaryAction>primary</InteractionTagPrimary>
  <InteractionTagSecondary
    aria-label="remove" // 1️⃣ only aria-label is needed, everything else is out of the box
  />
</InteractionTag>;

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 21, 2023

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-tags-preview
InteractionTag
14.23 kB
5.723 kB
14.356 kB
5.746 kB
126 B
23 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-tags-preview
Tag
30.349 kB
9.798 kB
react-tags-preview
TagGroup
72.851 kB
21.693 kB
🤖 This report was generated against 4942c5f07e08f1061cc8a6b753cd668b05482151

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 21, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5b658bc:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented Sep 21, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 4942c5f07e08f1061cc8a6b753cd668b05482151 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 21, 2023

🕵 fluentuiv9 No visual regressions between this PR and main

@YuanboXue-Amber YuanboXue-Amber marked this pull request as ready for review September 21, 2023 21:33
@YuanboXue-Amber YuanboXue-Amber requested review from a team as code owners September 21, 2023 21:33
@YuanboXue-Amber
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@YuanboXue-Amber YuanboXue-Amber requested a review from a team as a code owner September 25, 2023 09:02
@YuanboXue-Amber YuanboXue-Amber enabled auto-merge (squash) September 25, 2023 09:03
@YuanboXue-Amber YuanboXue-Amber merged commit c9b7dde into microsoft:master Sep 25, 2023
20 checks passed
@YuanboXue-Amber YuanboXue-Amber deleted the yuanboxue/tag-1 branch September 25, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Tag v9 Tag component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interaction tag labelling is only manual
4 participants