Skip to content

Commit 402fb2a

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

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

src/MatBlazor/Components/MatAutocompleteList/MatAutocompleteList.razor

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

src/MatBlazor/Components/MatIconButton/BaseMatIconButton.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public bool Toggled
4848
[Parameter]
4949
public EventCallback<bool> ToggledChanged { get; set; }
5050

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

src/MatBlazor/Components/MatIconButton/MatIconButton.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@namespace MatBlazor
22
@inherits BaseMatIconButton
33

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

src/MatBlazor/MatBlazor.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)