# L'autocompletamento del nome utente non scompare dopo aver digitato la virgola

**URL:** https://meta.discourse.org/t/username-autocomplete-does-not-go-away-after-typing-comma/109084
**Category:** Bug
**Created:** [13 Febbraio 2019, 9:17pm UTC](https://meta.discourse.org/t/username-autocomplete-does-not-go-away-after-typing-comma/109084 "2019-02-13T21:17:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jsha](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jsha/32/48894_2.png) [@jsha](https://meta.discourse.org/u/jsha)
#### Post date: [13 Febbraio 2019, 9:17pm UTC](https://meta.discourse.org/t/username-autocomplete-does-not-go-away-after-typing-comma/109084/1 "2019-02-13T21:17:03Z")

</div>

Steps to reproduce:

In a topic, type “Hi @username,\<enter\>”

Expected result:

Text box contains “Hi @username,” and a newline. Also, the username autocompletion box should go away after typing the comma.

Actual result:

Text box contains “Hi @username” and no newline. In other words, because the autocomplete stayed open after typing the comma, the \<enter\> was interpreted as selecting the username from the autocomplete. This wipes out the comma, and means that no newline is inserted.

This is on hosted Discourse, so presumably the latest version. [https://community.letsencrypt.org/](https://community.letsencrypt.org/).

Thanks very much!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [13 Febbraio 2019, 11:34pm UTC](https://meta.discourse.org/t/username-autocomplete-does-not-go-away-after-typing-comma/109084/2 "2019-02-13T23:34:13Z")

</div>

Should comma interrupt here @sam? That seems sensible to me so maybe you can allocate the work.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [14 Febbraio 2019, 12:03am UTC](https://meta.discourse.org/t/username-autocomplete-does-not-go-away-after-typing-comma/109084/3 "2019-02-14T00:03:53Z")

</div>

Yeah this is a quirk we should fix, it gets super weird cause it remains in place after ,SPACE which is extra weird.

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/2/c273b237032158660af51b5261913f587a972da2.png)

@dan can you add this to your list?

---

<div class="post-metadata">

### Author: ![dan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan/32/101549_2.png) [@dan](https://meta.discourse.org/u/dan)
#### Post date: [14 Febbraio 2019, 1:07pm UTC](https://meta.discourse.org/t/username-autocomplete-does-not-go-away-after-typing-comma/109084/4 "2019-02-14T13:07:27Z")

</div>

I have added a check on the client side to ensure that the search term is validated using same rule as on the server side (specifically `UsernameValidator.username_char_valid?`).

[https://github.com/discourse/discourse/pull/7005](https://github.com/discourse/discourse/pull/7005)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [14 Febbraio 2019, 10:43pm UTC](https://meta.discourse.org/t/username-autocomplete-does-not-go-away-after-typing-comma/109084/5 "2019-02-14T22:43:57Z")

</div>


