Skip to content

Commit e691ea7

Browse files
(Pill): restrict the container tag to span
see: https://v1.lightningdesignsystem.com/components/pills/#About-Pills
1 parent 7b1ef61 commit e691ea7

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/scripts/Pill.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, {
2-
ReactHTML,
32
HTMLAttributes,
43
MouseEvent,
54
KeyboardEvent,
@@ -18,7 +17,6 @@ export type PillProps = {
1817
label?: string;
1918
truncate?: boolean;
2019
disabled?: boolean;
21-
tag?: keyof ReactHTML;
2220
icon?: {
2321
category?: IconCategory;
2422
icon?: string;
@@ -35,7 +33,6 @@ export const Pill: FC<PillProps> = (props) => {
3533
icon,
3634
disabled,
3735
label,
38-
tag,
3936
truncate,
4037
className,
4138
pillRef,
@@ -57,15 +54,13 @@ export const Pill: FC<PillProps> = (props) => {
5754
}
5855
});
5956

60-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
61-
const Tag: any = disabled ? 'span' : tag || 'a';
6257
const pillClassNames = classnames(
6358
'slds-pill',
6459
{ 'slds-truncate': truncate },
6560
className
6661
);
6762
return (
68-
<Tag
63+
<span
6964
ref={pillRef}
7065
className={pillClassNames}
7166
onKeyDown={onKeyDown}
@@ -88,6 +83,6 @@ export const Pill: FC<PillProps> = (props) => {
8883
tabIndex={-1}
8984
onClick={onPillRemove}
9085
/>
91-
</Tag>
86+
</span>
9287
);
9388
};

0 commit comments

Comments
 (0)