Skip to content

Commit 5adf289

Browse files
committed
2 parents 032e365 + b1f9b17 commit 5adf289

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BlazorSortableJS is a Blazor Wrapper over JavaScript [Sortable](https://github.c
44

55
>Sortable is a JavaScript library for reorderable drag-and-drop lists.
66
7-
This is a very early project. However, it does function and is very much usable. The user experience will get better over.
7+
This is a very early project. However, it does function and is very much usable. The user experience will get better over time.
88

99
[![NuGet Pre Release](https://img.shields.io/nuget/vpre/BlazorSortableJS.svg)](https://www.nuget.org/packages/BlazorSortableJS/)
1010
- _host.cshtml
@@ -26,7 +26,6 @@ Sortable List
2626
@code
2727
{
2828
SortableGroup<string> MyGroup;
29-
bool FirstRun = true;
3029
List<string> items { get; set; } = new List<string> { "T1", "T2", "T3" };
3130
List<string> resultsList { get; set; } = new List<string>();
3231

@@ -36,17 +35,17 @@ Sortable List
3635
return base.OnInitializedAsync();
3736
}
3837

39-
protected async override Task OnAfterRenderAsync()
38+
protected override async Task OnAfterRenderAsync(bool firstRender)
4039
{
41-
if (FirstRun)
40+
if (firstRender)
4241
{
4342
MyGroup.Sortable.SetData(items);
44-
await MyGroup.Sortable.Create(MyGroup.Id, new SortableJsOptions
43+
await MyGroup.Sortable.CreateAsync(MyGroup.Id, new SortableJsOptions
4544
{
46-
group = "test",
47-
animation = 100,
45+
Group = "test",
46+
Animation = 100,
4847
});
49-
FirstRun = false;
48+
5049
StateHasChanged();
5150
}
5251
}

0 commit comments

Comments
 (0)