Skip to content

Commit e17ffcc

Browse files
committed
fix(tag): onclick handler cannot be set undefined
HCRC-178. The Tag onClick handler should be undefinable, because it also affects to the Tag styling, by adding border, if there is an onClick handler. Also, the onClick decorator that we were using, was totally needless, so now the HDS Tag onClick property is used directly instead.
1 parent 069da87 commit e17ffcc

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/common/components/tag/Tag.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,9 @@ export function Tag({
4242
* */
4343
const generatedId = React.useId();
4444

45-
const handleClick = (): void => {
46-
if (onClick) {
47-
onClick();
48-
}
49-
};
50-
5145
return (
5246
<HDSTag
53-
onClick={handleClick}
47+
onClick={onClick}
5448
{...(!onClick && { tabIndex: -1 })}
5549
theme={featured ? theme2 : theme1}
5650
className={classNames(

0 commit comments

Comments
 (0)