ant-design-blazor/components/mentions/Mentions.razor
Henry.zhang ef22dd5a1b feat: add mentions component (#286)
* feat: add mentions component

* fix: update with z-index

* feat: new mention components (unfinished)

* fix: show chinese letter for affix and tree

* refactor: clean code

* fix: the display position of the dropdown is consistent with the cursor

* fix: mistakes

Co-authored-by: ElderJames <shunjiey@hotmail.com>
Co-authored-by: zxyao <zxyao145@gmail.com>
2020-07-11 01:46:35 +08:00

59 lines
2.0 KiB
C#

@namespace AntDesign
@using AntDesign.Internal
@inherits AntDomComponentBase
<div class="@ClassMapper.Class">
<textarea @ref="@Ref"
@bind="@Value"
@attributes="@Attributes"
style="white-space: pre-wrap; @Style"
id="@Id"
rows="@Rows"
disabled="@Disable"
readonly="@Readonly"
placeholder="@Placeholder"
@onfocus="@Onfocus"
@onblur="@Onblur"
@onkeypress="@OnKeyPress"
@onkeydown="@OnKeyDown"
@onkeyup="@OnKeyUp" />
<CascadingValue Value="this">
@if (ShowSuggestions)
{
<div class="ant-mentions-measure" style="z-index:1050;">
<div>
<div class="ant-mentions-dropdown" style="@DropdownStyle">
<div class="ant-mentions-dropdown-menu" role="menu">
@if (LstOriginalOptions.Count > 0)
{
@if (Loading)
{
<MentionsOption Value="ANTD_SEARCHING" Disable="true">
<Spin Size="small"></Spin>
</MentionsOption>
}
else
{
foreach (var item in LstOriginalOptions)
{
<MentionsOption Value="@item.Value">@item.ChildContent</MentionsOption>
}
}
}
else
{
@ChildContent
}
</div>
</div>
</div>
</div>
}
</CascadingValue>
</div>