Skip to content

Commit 43ef015

Browse files
dstulskiDaniel Stulskiggdouglas
authored
[core] feat(Tag): a11y names for tags via button roles for tags with onClick behavior (#7490)
Co-authored-by: Daniel Stulski <[email protected]> Co-authored-by: Greg Douglas <[email protected]>
1 parent 10ad7af commit 43ef015

File tree

1 file changed

+6
-1
lines changed
  • packages/core/src/components/tag

1 file changed

+6
-1
lines changed

packages/core/src/components/tag/tag.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,12 @@ export const Tag: React.FC<TagProps> = React.forwardRef((props, ref) => {
135135
);
136136

137137
return (
138-
<span {...removeNonHTMLProps(htmlProps)} {...interactiveProps} className={tagClasses}>
138+
<span
139+
{...removeNonHTMLProps(htmlProps)}
140+
{...interactiveProps}
141+
className={tagClasses}
142+
role={isInteractive ? "button" : undefined}
143+
>
139144
<Icon icon={icon} />
140145
{!isReactNodeEmpty(children) && (
141146
<Text className={Classes.FILL} ellipsize={!multiline} tagName="span" title={htmlTitle}>

0 commit comments

Comments
 (0)