Skip to content

Commit

Permalink
Allow to specify type on MatIconButton. Fixes #315
Browse files Browse the repository at this point in the history
- Material icon button changes
- set type in Material autocomplete

Thanks!
  • Loading branch information
peterblazejewicz committed Oct 30, 2019
1 parent ed0c202 commit ad9a45d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@if (IsShowingClearButton)
{
<div class="mat-autocomplete-clearbutton">
<MatIconButton Icon="clear" OnMouseDown="@ClearText"></MatIconButton>
<MatIconButton Type="button" Icon="clear" OnMouseDown="@ClearText"></MatIconButton>
</div>
}
@if (Collection != null && IsOpened)
Expand Down
7 changes: 7 additions & 0 deletions src/MatBlazor/Components/MatIconButton/BaseMatIconButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ protected bool Toggled
}
}

/// <summary>
/// The default behavior of the button. Possible values are:
/// "button", "reset", "submit"
/// </summary>
[Parameter]
public string Type { get; set; }

/// <summary>
/// Navigate to this url when clicked.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/MatBlazor/Components/MatIconButton/MatIconButton.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@namespace MatBlazor
@inherits BaseMatIconButton

<button class="@ClassMapper.Class" style="@Style" @ref="Ref" disabled=@Disabled @onclick="OnClickHandler" @onmousedown="OnMouseDown" href=@Link @attributes="Attributes" Id="@Id">
<button class="@ClassMapper.Class" type=@Type style="@Style" @ref="Ref" disabled=@Disabled @onclick="OnClickHandler" @onmousedown="OnMouseDown" href=@Link @attributes="Attributes" Id="@Id">
@if (Icon != null)
{
@if (ToggleIcon != null && Toggled)
Expand Down
6 changes: 6 additions & 0 deletions src/MatBlazor/MatBlazor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ad9a45d

Please sign in to comment.