Skip to content

fix(Tag) No more accidentally passing active as html prop #7069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
CR
  • Loading branch information
jscheiny committed Nov 14, 2024
commit a05ac2c8587d00cb1e4216bba2924383d3bb1be6
13 changes: 10 additions & 3 deletions packages/core/src/components/tag/tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ import * as React from "react";
import type { IconName } from "@blueprintjs/icons";

import { useInteractiveAttributes } from "../../accessibility/useInteractiveAttributes";
import { Classes, DISPLAYNAME_PREFIX, type IntentProps, type MaybeElement, type Props, Utils } from "../../common";
import {
Classes,
DISPLAYNAME_PREFIX,
type IntentProps,
type MaybeElement,
type Props,
removeNonHTMLProps,
Utils,
} from "../../common";
import { isReactNodeEmpty } from "../../common/utils";
import { Icon } from "../icon/icon";
import { Text } from "../text/text";
Expand Down Expand Up @@ -73,7 +81,6 @@ export interface TagProps
*/
export const Tag: React.FC<TagProps> = React.forwardRef((props, ref) => {
const {
active: _active,
children,
className,
fill,
Expand Down Expand Up @@ -113,7 +120,7 @@ export const Tag: React.FC<TagProps> = React.forwardRef((props, ref) => {
);

return (
<span {...htmlProps} {...interactiveProps} className={tagClasses}>
<span {...removeNonHTMLProps(htmlProps)} {...interactiveProps} className={tagClasses}>
<Icon icon={icon} />
{!isReactNodeEmpty(children) && (
<Text className={Classes.FILL} ellipsize={!multiline} tagName="span" title={htmlTitle}>
Expand Down