diff options
author | Mackinnon Buck <mackinnon.buck@gmail.com> | 2020-09-11 20:07:00 +0300 |
---|---|---|
committer | Mackinnon Buck <mackinnon.buck@gmail.com> | 2020-09-11 20:07:00 +0300 |
commit | f21fdddc5c163caf816bba761a725d6deda5a3f7 (patch) | |
tree | 34181a2e2358b58aa07495aa126f998652c2d959 | |
parent | 83277a419ae2066b44e717519106f1e7701ed455 (diff) |
Updated comments.t-mabuc/drag-and-drop
4 files changed, 5 insertions, 4 deletions
diff --git a/src/Components/Web.Extensions/src/DragAndDrop/Drag.cs b/src/Components/Web.Extensions/src/DragAndDrop/Drag.cs index c4f56803f0..019e796aba 100644 --- a/src/Components/Web.Extensions/src/DragAndDrop/Drag.cs +++ b/src/Components/Web.Extensions/src/DragAndDrop/Drag.cs @@ -10,9 +10,6 @@ namespace Microsoft.AspNetCore.Components.Web.Extensions { public class Drag<TItem> : ComponentBase, IAsyncDisposable { - // TODO: Could pass the item around via DotNetObjectReference, but that requires it to be a reference - // type, which is a rather limiting constraint. - private long _id; [Inject] @@ -24,6 +21,8 @@ namespace Microsoft.AspNetCore.Components.Web.Extensions [Parameter] public TItem Item { get; set; } = default!; + // TODO: These could be turned into EventCallbacks. + [Parameter] public Action<TItem, MutableDragEventArgs>? OnDragStart { get; set; } diff --git a/src/Components/Web.Extensions/src/DragAndDrop/Drop.cs b/src/Components/Web.Extensions/src/DragAndDrop/Drop.cs index 1cd7c3f486..88a999d255 100644 --- a/src/Components/Web.Extensions/src/DragAndDrop/Drop.cs +++ b/src/Components/Web.Extensions/src/DragAndDrop/Drop.cs @@ -22,6 +22,8 @@ namespace Microsoft.AspNetCore.Components.Web.Extensions [Parameter] public Func<TItem, bool>? CanDrop { get; set; } + // TODO: These could be turned into EventCallbacks. + [Parameter] public Action<TItem, MutableDragEventArgs>? OnDrop { get; set; } diff --git a/src/Components/Web.Extensions/src/wwwroot/dragAndDrop.js b/src/Components/Web.Extensions/src/wwwroot/dragAndDrop.js index c5becaf77d..737d6db38e 100644 --- a/src/Components/Web.Extensions/src/wwwroot/dragAndDrop.js +++ b/src/Components/Web.Extensions/src/wwwroot/dragAndDrop.js @@ -4,7 +4,6 @@ // For example, onDragStart is async. onDragEnd could fire before onDragStart completes if the user is fast enough. We could extend // the current waiting mechanism to support multiple states (right now, it's used only to delay tasks until after onDragEnd completes). // TODO: Implement the rest of the drag events: https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API - // TODO: implement the missing features, e.g. updateDataTransfer let nextDragHandleId = 0; let nextDropHandleId = 0; diff --git a/src/Components/test/testassets/BasicTestApp/DragAndDropComponent.razor b/src/Components/test/testassets/BasicTestApp/DragAndDropComponent.razor index 02adff51b2..be2cb3a575 100644 --- a/src/Components/test/testassets/BasicTestApp/DragAndDropComponent.razor +++ b/src/Components/test/testassets/BasicTestApp/DragAndDropComponent.razor @@ -8,6 +8,7 @@ <h3>List of people</h3> @foreach (var item in personList) { + @*TODO: avoid having to specify a @key here?*@ <Drag Item="item" OnDragStart="OnDragStart" OnDragEnd="OnDragEnd" @key="item"> @item.Name </Drag> |