Skip to content

Commit

Permalink
Merge 984d4f6 into 5b2669d
Browse files Browse the repository at this point in the history
  • Loading branch information
andnorda authored Aug 3, 2023
2 parents 5b2669d + 984d4f6 commit d82bf4f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-bulldogs-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-react": patch
---

Chips: Removable Chips submitter ikke forms ved klikk lengre
16 changes: 8 additions & 8 deletions @navikt/core/react/src/chips/Removable.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { XMarkIcon } from "@navikt/aksel-icons";
import cl from "clsx";
import React, { forwardRef } from "react";
import { OverridableComponent } from "../util/OverridableComponent";

export interface RemovableChipsProps
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
Expand All @@ -22,26 +21,27 @@ export interface RemovableChipsProps
onDelete?: () => void;
}

export const RemovableChips: OverridableComponent<
RemovableChipsProps,
HTMLButtonElement
> = forwardRef(
export const RemovableChips = forwardRef<
HTMLButtonElement,
RemovableChipsProps
>(
(
{
className,
children,
variant = "action",
as: Component = "button",
removeLabel = "slett",
onDelete,
type = "button",
...rest
},
ref
) => {
return (
<Component
<button
{...rest}
ref={ref}
type={type}
className={cl(
"navds-chips__chip navds-chips__removable navds-chips--icon-right",
className,
Expand All @@ -57,7 +57,7 @@ export const RemovableChips: OverridableComponent<
<span className="navds-chips__removable-icon">
<XMarkIcon aria-hidden />
</span>
</Component>
</button>
);
}
);
Expand Down

0 comments on commit d82bf4f

Please sign in to comment.