Skip to content

Commit 9999788

Browse files
authored
feat(Touchable components): add support for aria-description, aria-describedby, aria-labelledby and aria-current (#1390)
WEB-2149 WEB-2255
1 parent 5ebd350 commit 9999788

6 files changed

Lines changed: 222 additions & 56 deletions

File tree

src/button.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,13 @@ interface CommonProps {
276276
/** "data-" prefix is automatically added. For example, use "testid" instead of "data-testid" */
277277
dataAttributes?: DataAttributes;
278278
'aria-label'?: string;
279+
'aria-labelledby'?: string;
279280
'aria-controls'?: string;
280281
'aria-expanded'?: 'true' | 'false' | boolean;
281282
'aria-haspopup'?: 'true' | 'false' | 'menu' | 'dialog' | boolean;
283+
'aria-current'?: React.AriaAttributes['aria-current'];
284+
'aria-description'?: string;
285+
'aria-describedby'?: string;
282286
tabIndex?: number;
283287
StartIcon?: (props: IconProps) => JSX.Element;
284288
EndIcon?: (props: IconProps) => JSX.Element;
@@ -432,9 +436,13 @@ const BaseButton = React.forwardRef<
432436
trackingEvent: props.trackingEvent ?? (props.trackEvent ? createDefaultTrackingEvent() : undefined),
433437
dataAttributes: props.dataAttributes,
434438
'aria-label': props['aria-label'],
439+
'aria-labelledby': props['aria-labelledby'],
435440
'aria-controls': props['aria-controls'],
436441
'aria-expanded': props['aria-expanded'],
437442
'aria-haspopup': props['aria-haspopup'],
443+
'aria-current': props['aria-current'],
444+
'aria-description': props['aria-description'],
445+
'aria-describedby': props['aria-describedby'],
438446
tabIndex: props.tabIndex,
439447
children: renderButtonContent({
440448
showSpinner,

0 commit comments

Comments
 (0)