-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IconButton: Add type=submit prop to allow submitting forms using the …
…button (#2325) ## Summary: This PR adds a new prop `type` to the `IconButton` component that allows the button to submit a form when clicked or pressed. This is useful when we want to use an IconButton to submit a form, for example, a search form. This is done as I noticed that the IconButton component is missing the `type` and was needed in the search page. The prop is currently set, but the type definition is missing. Issue: FEI-5728 ## Test plan: Docs: - Navigate to /?path=/docs/packages-iconbutton--docs#submitting%20forms - Verify that the docs make sense. Interactive example: - Navigate to /?path=/story/packages-iconbutton--submitting-forms - Verify that the submit action is recorded in the SB `Actions` tab. <img width="1396" alt="Screenshot 2024-09-19 at 10 14 56 AM" src="https://github.com/user-attachments/assets/1afb059a-6537-494e-af55-8cfe95c962ea"> Author: jandrade Reviewers: beaesguerra, jandrade Required Reviewers: Approved By: beaesguerra Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Test (ubuntu-latest, 20.x, 2/2), ✅ Lint (ubuntu-latest, 20.x), ✅ Test (ubuntu-latest, 20.x, 1/2), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, ⏭️ dependabot Pull Request URL: #2325
- Loading branch information
Showing
4 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@khanacademy/wonder-blocks-icon-button": minor | ||
--- | ||
|
||
Add type=submit prop to allow submitting forms with the button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters