Skip to content

Commit

Permalink
Fixed Icon Button's OnSelectedChanged event having the wrong paramete…
Browse files Browse the repository at this point in the history
…r type.
  • Loading branch information
datvm committed Apr 30, 2024
1 parent 1a4b001 commit 29a3ec6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
19 changes: 11 additions & 8 deletions BlazorMaterialWeb.Demo/Pages/IconButton.razor
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,27 @@
{
<div class="col">
<p>
<MdIconButton @bind-Selected="@(selected)"
@onclick="@(() => clicked = style.ToString())"
<MdIconButton @bind-Selected="@(selected)" @bind-Selected:after="() => ++toggleCount"
@onclick="@(() => clicked = style.ToString())"
ButtonStyle="@(style)"
Href="@(hasHref ? "https://github.com/datvm/BlazorMaterialWeb/" : null)"
Target="@(hasHref && targetBlank ? "_blank" : null)"
Toggle="@(toggle)"
Disabled="@(disabled)"
FlipIconInRtl="isRtl">
<MdIcon>@(icon)</MdIcon>
</MdIconButton>
</p>
<p>@(style)</p>
</MdIconButton>
</p>
<p>@(style)</p>
</div>
}
</div>
}

<div>
You have clicked: @(clicked ?? "Not yet")<br />
Selected (Toggle button): @selected.ToString()
Selected (Toggle button): @selected.ToString()<br />
Toggle changed count: @(toggleCount)
</div>
</ComponentDemo>
<Tweaks>
Expand Down Expand Up @@ -78,21 +79,23 @@
</Tweaks>
</ComponentDemoPage>

@code {
@code {
const string icon = "send";

string function = "Button";
bool selected;
bool disabled;

string? clicked;

bool button = true;
bool toggle;
bool hasHref;

bool targetBlank;

int toggleCount;

void SetTo()
{
button = function == "Button";
Expand Down
2 changes: 1 addition & 1 deletion BlazorMaterialWeb/MdIconButton.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ partial class MdIconButton
_ => throw new NotImplementedException("Unknown style: " + ButtonStyle.ToString()),
};

async Task OnSelectedChanged(MdCheckedEventArgs e)
async Task OnSelectedChanged(MdCheckboxChangeEventArgs e)
{
Selected = e.Checked;
await SelectedChanged.InvokeAsync(Selected);
Expand Down
2 changes: 1 addition & 1 deletion pack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ foreach($file in $files) {
rm $file.FullName
}

$version="--property:Version=1.2.0.0"
$version="--property:Version=1.3.0.1"

dotnet pack .\BlazorMaterialWeb\BlazorMaterialWeb.csproj -c Release "--property:PackageOutputPath=.\bin\nuget" "$version"
dotnet pack .\BlazorMaterialWeb.Bundled\BlazorMaterialWeb.Bundled.csproj -c Release "--property:PackageOutputPath=.\bin\nuget" "$version"

0 comments on commit 29a3ec6

Please sign in to comment.