-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#789 HxContextMenuItem does not stop click propagation - repro test
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@page "/HxContextMenu_Issue789_Test" | ||
|
||
<h3>HxContextMenu_Issue789_Test</h3> | ||
|
||
<HxAccordion StayOpen="true"> | ||
@foreach (var word in words) | ||
{ | ||
<HxAccordionItem> | ||
<HeaderTemplate> | ||
<HxContextMenu> | ||
<HxContextMenuItem Icon="BootstrapIcon.Trash" Text="Remove this word" OnClick="@(() => RemoveWordFromList(word))" OnClickStopPropagation="true" /> | ||
</HxContextMenu> | ||
@word.Name | ||
</HeaderTemplate> | ||
<BodyTemplate> | ||
<HxInputText Label="Word" @bind-Value="@word.Name" /> | ||
</BodyTemplate> | ||
</HxAccordionItem> | ||
} | ||
</HxAccordion> | ||
|
||
@code | ||
{ | ||
public class WordDto | ||
{ | ||
public string Name { get; set; } = string.Empty; | ||
} | ||
|
||
private List<WordDto> words = new() { new WordDto { Name = "test" } }; | ||
|
||
private void RemoveWordFromList(WordDto word) | ||
{ | ||
words.Remove(word); | ||
} | ||
} |