Skip to content

Commit ac62923

Browse files
georgedautovdimodi
andauthored
Apply suggestions from code review
Co-authored-by: Dimo Dimov <[email protected]>
1 parent abcbc28 commit ac62923

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

knowledge-base/editor-mentions.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ For dynamic positioning of the mentions list, set the [`EditMode`](slug:Telerik.
4141
````SH.skip-repl
4242
npm init -y
4343
````
44-
> This command creates a `package.json` file containing the project's configuration. The `-y` flag accepts all defaults for simplicity. In a real world application, consider running `npm init` without the flag to configure settings interactively.
44+
> This command creates a `package.json` file with the project's configuration. The `-y` flag accepts all defaults for simplicity. In a real world application, consider running `npm init` without the flag to configure settings interactively.
4545
2. Install a JavaScript bundler. In this example we will use [webpack](https://webpack.js.org), so run:
4646
````SH.skip-repl
4747
npm install webpack webpack-cli --save-dev
@@ -61,7 +61,7 @@ For dynamic positioning of the mentions list, set the [`EditMode`](slug:Telerik.
6161
````SH.skip-repl
6262
npm install prosemirror-mentions
6363
````
64-
7. Create a file named `index.js` in your project's `wwwroot/js` directory and paste the contents from the **JavaScript Code** section below.
64+
7. Create a file named `index.js` in your project's `wwwroot/js` directory and paste the contents from the respective code tab below.
6565
8. Build the JavaScript bundle by running:
6666
````SH.skip-repl
6767
npm run build
@@ -175,37 +175,38 @@ The following code demonstrates how to integrate the `proseMirror-mentions` plug
175175
````razor MentionSuggestionList.razor
176176
@*
177177
IMPORTANT: outer div's "suggestion-item-list" class is mandatory. The plugin uses this class for querying.
178-
IMPORTANT: inner div's "suggestion-item" class is mandatory too for the same reasons
178+
IMPORTANT: inner div's "suggestion-item" class is mandatory too for the same reasons.
179179
*@
180180
181-
<div class="suggestion-item-list">
182-
@if (Items == null || Items.Count() == 0)
183-
{
184-
<div class="suggestion-item">
185-
No suggestions
186-
</div>
187-
} else
188-
{
189-
@foreach (Mention item in Items) {
190-
<div class="suggestion-item">
191-
<div class="suggestion-item-content">
192-
<div class="suggestion-text">
193-
<div class="suggestion-name">
181+
<div class="suggestion-item-list k-popup k-list-container" style="max-height: 200px;">
182+
<div class="k-list">
183+
<div class="k-list-content">
184+
<ul class="k-list-ul">
185+
@if (Items == null || Items.Count() == 0)
186+
{
187+
<li class="suggestion-item k-list-item">
188+
No Suggestions
189+
</li>
190+
}
191+
else
192+
{
193+
@foreach (Mention item in Items)
194+
{
195+
<li class="suggestion-item k-list-item">
194196
@item.Name
195-
</div>
196-
<div class="suggestion-title">
197+
<br />
197198
@item.Email
198-
</div>
199-
</div>
200-
</div>
201-
</div>
202-
}
203-
}
199+
</li>
200+
}
201+
}
202+
</ul>
203+
</div>
204+
</div>
204205
</div>
205206
206207
@code {
207208
[Parameter]
208-
public IEnumerable<Mention> Items { get; set; }
209+
public IEnumerable<Mention>? Items { get; set; }
209210
}
210211
````
211212
````cs Mention.cs

0 commit comments

Comments
 (0)