You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Item
{
public int Id { get; set; }
public string Name { get; set; } = "";
public bool Disabled { get; set; } = false;
}
public List<Item> items = Enumerable.Range(1, 10).Select(i => new Item { Id = i, Name = $"Item {i}" }).ToList();
private void SortList(FluentSortableListEventArgs args)
{
if (args is null || args.OldIndex == args.NewIndex)
{
return;
}
var oldIndex = args.OldIndex;
var newIndex = args.NewIndex;
var items = this.items;
var itemToMove = items[oldIndex];
items.RemoveAt(oldIndex);
if (newIndex < items.Count)
{
items.Insert(newIndex, itemToMove);
}
else
{
items.Add(itemToMove);
}
}
🐛 Bug Report
FluentSortableList demo is failing with error "Sortable is not defined".
💻 Repro or Code Sample
@page "/Test2"
@context.Name@rendermode InteractiveServer
@code {
}
🤔 Expected Behavior
A page with a sortable list.
😯 Current Behavior
Get the following error in the browser:
[2024-05-10T15:44:12.000Z] Error: Microsoft.JSInterop.JSException: Sortable is not defined
ReferenceError: Sortable is not defined
at Module.init (https://localhost:7253/_content/Microsoft.FluentUI.AspNetCore.Components/Components/SortableList/FluentSortableList.razor.js:2:5)
at https://localhost:7253/_framework/blazor.web.js:1:3244
at new Promise ()
at y.beginInvokeJSFromDotNet (https://localhost:7253/_framework/blazor.web.js:1:3201)
at fn._invokeClientMethod (https://localhost:7253/_framework/blazor.web.js:1:62914)
at fn.processIncomingData (https://localhost:7253/_framework/blazor.web.js:1:60389)
at connection.onreceive (https://localhost:7253/_framework/blazor.web.js:1:54030)
at i.onmessage (https://localhost:7253/_framework/blazor.web.js:1:82175)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Microsoft.FluentUI.AspNetCore.Components.FluentSortableList`1.OnAfterRenderAsync(Boolean firstRender) in //src/Core/Components/SortableList/FluentSortableList.razor.cs:line 105
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
💁 Possible Solution
🔦 Context
I am trying to add a two list sort to my application.
🌍 Your Environment
Windows
Google Chrome
.net 8.0.4
Flueint UI Blazor Library 4.7.2
The text was updated successfully, but these errors were encountered: