Add support for ARIA 1.3 attributes (#34264)

Co-authored-by: Abdulwahab Omira <abdulwahabomira@gmail.com>
Co-authored-by: Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
This commit is contained in:
Abdulwahab Omira 2025-08-22 09:22:18 -05:00 committed by GitHub
parent 11d7bcf88c
commit 698bb4deb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 0 deletions

View File

@ -59,6 +59,11 @@ const ariaProperties = {
'aria-rowindex': 0, 'aria-rowindex': 0,
'aria-rowspan': 0, 'aria-rowspan': 0,
'aria-setsize': 0, 'aria-setsize': 0,
// ARIA 1.3 Attributes
'aria-braillelabel': 0,
'aria-brailleroledescription': 0,
'aria-colindextext': 0,
'aria-rowindextext': 0,
}; };
export default ariaProperties; export default ariaProperties;

View File

@ -37,6 +37,27 @@ describe('ReactDOMInvalidARIAHook', () => {
it('should allow valid aria-* props', async () => { it('should allow valid aria-* props', async () => {
await mountComponent({'aria-label': 'Bumble bees'}); await mountComponent({'aria-label': 'Bumble bees'});
}); });
it('should allow new ARIA 1.3 attributes', async () => {
// Test aria-braillelabel
await mountComponent({'aria-braillelabel': 'Braille label text'});
// Test aria-brailleroledescription
await mountComponent({'aria-brailleroledescription': 'Navigation menu'});
// Test aria-colindextext
await mountComponent({'aria-colindextext': 'Column A'});
// Test aria-rowindextext
await mountComponent({'aria-rowindextext': 'Row 1'});
// Test multiple ARIA 1.3 attributes together
await mountComponent({
'aria-braillelabel': 'Braille text',
'aria-colindextext': 'First column',
'aria-rowindextext': 'First row',
});
});
it('should warn for one invalid aria-* prop', async () => { it('should warn for one invalid aria-* prop', async () => {
await mountComponent({'aria-badprop': 'maybe'}); await mountComponent({'aria-badprop': 'maybe'});
assertConsoleErrorDev([ assertConsoleErrorDev([