Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

feat(Dialog): add default aria-labelledby if not provided#1298

Merged
silviuaavram merged 9 commits intomasterfrom
feat/dialog-default-aria-labelledby
May 10, 2019
Merged

feat(Dialog): add default aria-labelledby if not provided#1298
silviuaavram merged 9 commits intomasterfrom
feat/dialog-default-aria-labelledby

Conversation

@silviuaavram
Copy link
Collaborator

Fixes #812.

If Dialog has aria-label, do nothing.
If Dialog has aria-labelledbby, do nothing.
If Dialog does not have aria-label or aria-labelledby, get id from header prop and use it as aria-labelledby in Dialog.
If Dialog does not have aria-label or aria-labelledby, and header is string or simply has no id, generate id and add it as default prop to header and as aria-labelledby to Dialog.

@codecov
Copy link

codecov bot commented May 7, 2019

Codecov Report

Merging #1298 into master will increase coverage by 0.37%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1298      +/-   ##
==========================================
+ Coverage   72.18%   72.55%   +0.37%     
==========================================
  Files         754      754              
  Lines        5622     5647      +25     
  Branches     1671     1653      -18     
==========================================
+ Hits         4058     4097      +39     
+ Misses       1557     1544      -13     
+ Partials        7        6       -1
Impacted Files Coverage Δ
packages/react/src/components/Dialog/Dialog.tsx 36.11% <100%> (+36.11%) ⬆️
...ages/react/test/specs/behaviors/testDefinitions.ts 94.47% <100%> (+0.21%) ⬆️
...b/accessibility/Behaviors/Dialog/dialogBehavior.ts 100% <100%> (ø) ⬆️
packages/react/src/components/Portal/Portal.tsx 100% <0%> (+5%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98014ec...e583074. Read the comment docs.

@silviuaavram silviuaavram force-pushed the feat/dialog-default-aria-labelledby branch from 49c1c76 to adc7244 Compare May 9, 2019 06:27
@silviuaavram silviuaavram merged commit 237e383 into master May 10, 2019
@delete-merged-branch delete-merged-branch bot deleted the feat/dialog-default-aria-labelledby branch May 10, 2019 08:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dialog: add aria-attributes

4 participants