-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Button): remove default
type="button"
(#2472)
When we set this as a default, it is also added to the component it composes to. `a` in a normal thing to change button to, which would lead to `<a href="*" type="button">min lenke som ikkje er knapp</a>` `type="button"` also deviates from the standard type of a `button`. I think we should remove our default, and keep the standard type. We will have to make sure to update components such as `Pagination` to set `type="button"` I did a workaround for this in `PaginationButton`, as this has the same problem, but we need to make sure all buttons there won't submit a form. We could also rely on our consumers to add this here, but that feels off, since it is in a pagination context, and not a "styled button" context. --------- Co-authored-by: Eirik Backer <[email protected]>
- Loading branch information
1 parent
a0fe525
commit dacf6f0
Showing
3 changed files
with
19 additions
and
3 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 @@ | ||
--- | ||
"@digdir/designsystemet-react": patch | ||
--- | ||
|
||
Button: Remove `type` when `asChild={true}` |
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