Skip to content

Commit

Permalink
LG-4809: Fix InfoSprinkle button type (#2664)
Browse files Browse the repository at this point in the history
* Fix InfoSprinkle button type

* Changeset
  • Loading branch information
stephl3 authored Jan 28, 2025
1 parent 68964f5 commit 78efdc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/spicy-melons-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@leafygreen-ui/info-sprinkle': patch
---

The `trigger` associated with the `InfoSprinkle` component was previously a `<button>` element using the default `type="submit"`. When an `InfoSprinkle` instance was used in a `<form>` element, clicking would unexpectedly submit form data to the server. The `<button>` element now uses `type="button"` to prevent this behavior.
1 change: 1 addition & 0 deletions packages/info-sprinkle/src/InfoSprinkle/InfoSprinkle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const InfoSprinkle = React.forwardRef<
<button
data-testid="info-sprinkle-icon"
aria-label="more info"
type="button"
{...triggerProps}
aria-disabled
ref={forwardRef}
Expand Down

0 comments on commit 78efdc9

Please sign in to comment.