Skip to content

Commit 698bb4d

Browse files
Abdul-OmiraAbdulwahab Omiraeps1lon
authored
Add support for ARIA 1.3 attributes (#34264)
Co-authored-by: Abdulwahab Omira <[email protected]> Co-authored-by: Sebastian Sebbie Silbermann <[email protected]>
1 parent 11d7bcf commit 698bb4d

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

packages/react-dom-bindings/src/shared/validAriaProperties.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ const ariaProperties = {
5959
'aria-rowindex': 0,
6060
'aria-rowspan': 0,
6161
'aria-setsize': 0,
62+
// ARIA 1.3 Attributes
63+
'aria-braillelabel': 0,
64+
'aria-brailleroledescription': 0,
65+
'aria-colindextext': 0,
66+
'aria-rowindextext': 0,
6267
};
6368

6469
export default ariaProperties;

packages/react-dom/src/__tests__/ReactDOMInvalidARIAHook-test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,27 @@ describe('ReactDOMInvalidARIAHook', () => {
3737
it('should allow valid aria-* props', async () => {
3838
await mountComponent({'aria-label': 'Bumble bees'});
3939
});
40+
41+
it('should allow new ARIA 1.3 attributes', async () => {
42+
// Test aria-braillelabel
43+
await mountComponent({'aria-braillelabel': 'Braille label text'});
44+
45+
// Test aria-brailleroledescription
46+
await mountComponent({'aria-brailleroledescription': 'Navigation menu'});
47+
48+
// Test aria-colindextext
49+
await mountComponent({'aria-colindextext': 'Column A'});
50+
51+
// Test aria-rowindextext
52+
await mountComponent({'aria-rowindextext': 'Row 1'});
53+
54+
// Test multiple ARIA 1.3 attributes together
55+
await mountComponent({
56+
'aria-braillelabel': 'Braille text',
57+
'aria-colindextext': 'First column',
58+
'aria-rowindextext': 'First row',
59+
});
60+
});
4061
it('should warn for one invalid aria-* prop', async () => {
4162
await mountComponent({'aria-badprop': 'maybe'});
4263
assertConsoleErrorDev([

0 commit comments

Comments
 (0)