Skip to content

Commit 4c6c997

Browse files
authored
fix(react-tags): set default button type if dismissible (microsoft#35088)
1 parent 33e550c commit 4c6c997

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "fix: set default button type for dismissible",
4+
"packageName": "@fluentui/react-tags",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/react-components/react-tags/library/src/components/Tag/useTag.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ export const useTag_unstable = (props: TagProps, ref: React.Ref<HTMLSpanElement
9494
id,
9595
...(dismissible && { onClick: dismissOnClick, onKeyDown: dismissOnKeyDown }),
9696
}),
97-
{ elementType },
97+
{
98+
defaultProps: {
99+
type: elementType === 'button' ? 'button' : undefined,
100+
},
101+
elementType,
102+
},
98103
),
99104

100105
media: slot.optional(props.media, { elementType: 'span' }),

0 commit comments

Comments
 (0)