Fixed Space in username makes it difficult to tag

NicolasZN

Well-known member
Affected version
2.x
Description: When tagging a user via @ in the editor, if the username has a space in it it stops suggesting names beyond the space.

Context: My site is a Harry Potter RPG and each account is a character's name, which almost always means a space in the username. Some beginnings of names are quite common, and if the name doesn't appear in the first dropdown it's impossible to have the person you're trying to tag appear after the space. (For example, in the first screenshot, you can see that there are several accounts that begin with "Professor" but if I want to tag "Professor Monty Pendleton" the name doesn't appear and continuing to type the name will escape the tagging function.

I know this will be tricky (if even possible) to resolve, given the infrequency of usernames with spaces that require being tagged with the dropdown of username suggestions.
Perhaps the dropdown could treat an underscore as including spaces so "@Professor_M" includes usernames that start with "Professor M" in the dropdown?
 

Attachments

  • Screen Shot 2019-08-05 at 11.38.32.webp
    Screen Shot 2019-08-05 at 11.38.32.webp
    69.5 KB · Views: 11
  • Screen Shot 2019-08-05 at 11.38.37.webp
    Screen Shot 2019-08-05 at 11.38.37.webp
    21.7 KB · Views: 10
It's actually not the space exactly that is the problem:

1565021790644.webp

You can see here if you keep on typing, the suggestions still display.

Unfortunately, that won't work with @Professor ...

The reason being is we expect a fairly specific username to search upon within the first 10 characters. We do have to have a cut off point because otherwise I could have put an @ symbol at the beginning of this sentence and it would still think I'm trying to mention someone, and sending unnecessary queries to the server.

I guess we'll just increase the limit to 15 characters though of course there will always be an edge case where this isn't enough!

And, just to be clear, a space will hide the suggestion list, but in the next release @Professor M should work how you expect it to (and similar to my screenshot above).
 
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.4).

Change log:
Increase the maximum query length for the auto-completer to 15 characters (from 10).
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Back
Top Bottom