Skip to content

Commit ad9a45d

Browse files
Allow to specify type on MatIconButton. Fixes #315
- Material icon button changes - set type in Material autocomplete Thanks!
1 parent ed0c202 commit ad9a45d

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

src/MatBlazor/Components/MatAutocomplete/MatAutocomplete.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@if (IsShowingClearButton)
1010
{
1111
<div class="mat-autocomplete-clearbutton">
12-
<MatIconButton Icon="clear" OnMouseDown="@ClearText"></MatIconButton>
12+
<MatIconButton Type="button" Icon="clear" OnMouseDown="@ClearText"></MatIconButton>
1313
</div>
1414
}
1515
@if (Collection != null && IsOpened)

src/MatBlazor/Components/MatIconButton/BaseMatIconButton.cs

+7
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ protected bool Toggled
4747
}
4848
}
4949

50+
/// <summary>
51+
/// The default behavior of the button. Possible values are:
52+
/// "button", "reset", "submit"
53+
/// </summary>
54+
[Parameter]
55+
public string Type { get; set; }
56+
5057
/// <summary>
5158
/// Navigate to this url when clicked.
5259
/// </summary>

src/MatBlazor/Components/MatIconButton/MatIconButton.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@namespace MatBlazor
22
@inherits BaseMatIconButton
33

4-
<button class="@ClassMapper.Class" style="@Style" @ref="Ref" disabled=@Disabled @onclick="OnClickHandler" @onmousedown="OnMouseDown" href=@Link @attributes="Attributes" Id="@Id">
4+
<button class="@ClassMapper.Class" type=@Type style="@Style" @ref="Ref" disabled=@Disabled @onclick="OnClickHandler" @onmousedown="OnMouseDown" href=@Link @attributes="Attributes" Id="@Id">
55
@if (Icon != null)
66
{
77
@if (ToggleIcon != null && Toggled)

src/MatBlazor/MatBlazor.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)