diff --git a/.changeset/bright-bulldogs-shave.md b/.changeset/bright-bulldogs-shave.md new file mode 100644 index 0000000000..c02468db85 --- /dev/null +++ b/.changeset/bright-bulldogs-shave.md @@ -0,0 +1,5 @@ +--- +"@navikt/ds-react": patch +--- + +Chips: Removable Chips submitter ikke forms ved klikk lengre diff --git a/@navikt/core/react/src/chips/Removable.tsx b/@navikt/core/react/src/chips/Removable.tsx index ea583d787e..21804741d2 100644 --- a/@navikt/core/react/src/chips/Removable.tsx +++ b/@navikt/core/react/src/chips/Removable.tsx @@ -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 { @@ -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 ( - - + ); } );