File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
modules/ROOT/examples/live-demos/mentions Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ tinymce.ScriptLoader.loadScripts(['https://cdn.jsdelivr.net/npm/faker@5/dist/fak
2121 for ( let i = 0 ; i < 200 ; i ++ ) {
2222 userNames . push ( faker . name . findName ( ) ) ;
2323 }
24+ userNames . sort ( ( a , b ) => a . localeCompare ( b ) ) ;
2425
2526 /* This represents a database of users on the server */
2627 const userDb = { } ;
@@ -79,7 +80,7 @@ tinymce.ScriptLoader.loadScripts(['https://cdn.jsdelivr.net/npm/faker@5/dist/fak
7980 }
8081 usersRequest . then ( ( users ) => {
8182 /* `query.term` is the text the user typed after the '@' */
82- users = users . filter ( ( user ) => user . name . indexOf ( query . term . toLowerCase ( ) ) !== - 1 ) ;
83+ users = users . filter ( ( user ) => user . name . toLowerCase ( ) . includes ( query . term . toLowerCase ( ) ) )
8384
8485 users = users . slice ( 0 , 10 ) ;
8586
You can’t perform that action at this time.
0 commit comments