mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
Add support for ARIA 1.3 attributes (#34264)
Co-authored-by: Abdulwahab Omira <[email protected]> Co-authored-by: Sebastian Sebbie Silbermann <[email protected]>
This commit is contained in:
committed by
GitHub
co-authored by
Abdulwahab Omira
Sebastian Sebbie Silbermann
parent
af7fc7c297
commit
cc2e4a24c4
@@ -59,6 +59,11 @@ const ariaProperties = {
|
||||
'aria-rowindex': 0,
|
||||
'aria-rowspan': 0,
|
||||
'aria-setsize': 0,
|
||||
// ARIA 1.3 Attributes
|
||||
'aria-braillelabel': 0,
|
||||
'aria-brailleroledescription': 0,
|
||||
'aria-colindextext': 0,
|
||||
'aria-rowindextext': 0,
|
||||
};
|
||||
|
||||
export default ariaProperties;
|
||||
|
||||
@@ -37,6 +37,27 @@ describe('ReactDOMInvalidARIAHook', () => {
|
||||
it('should allow valid aria-* props', async () => {
|
||||
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 () => {
|
||||
await mountComponent({'aria-badprop': 'maybe'});
|
||||
assertConsoleErrorDev([
|
||||
|
||||
Reference in New Issue
Block a user