nth-cloud / ng-mentions

Rich Mentions Component for Angular
http://nth-cloud.github.io/ng-mentions
MIT License
12 stars 12 forks source link

Feature to allow "Mention" value to contain spaces #34

Closed Jagan-P closed 2 years ago

Jagan-P commented 2 years ago

Feature description:

Can we please have a feature to allow spaces in "Mention" values which is not possible right now.

image

Version of Angular and ng-mentions:

Angular: NA

ng-mentions: NA

trickeyone commented 2 years ago

This is an actual limitation that I had actually spent a lot of time trying to overcome. Unfortunately, if you're wanting simple strings as the mentions (with no special formatting), then this is not possible. You're welcome to try and come up with a workable solution, but I don't currently have the bandwidth to try and find a 100% solution at this time.

Jagan-P commented 2 years ago

Oh okay. How do we achieve it with "special formatting"? Could you please help me with suitable example? I just want the mentions to be searchable with spaces.

trickeyone commented 2 years ago

@Jagan-P If you look at any of the other examples, you'll see that one of the searchable mentions has a space in the name. The example that says that spaces can't be included is for mentions that aren't formatted. This simply refers to the markup that is passed to the component, this default value is @[__display__](__type__:__id__). For the string example you referred to, the markup is set to only be @__display__ which can only search for, format, and display the simple string value for the mention. If you are wanting to have more complex mentions (i.e. spaces in the mention) then you'll need to use the default behavior with at least something similar to the markup indicated.

You'll notice that the markup contains placeholders for the values listed for the mentions (i.e. id, display, and type). The component uses the markup indicated to know how for format the mention object and display it.

Jagan-P commented 2 years ago

Oh okay. I think I wrongly communicated my need.

In the first example here (https://nth-cloud.github.io/ng-mentions/#/docs/mentions/examples), there is a mention "Bob Ross" which has a space in it. But as soon as I type "Bob " (add a space), the dropdown closes. Is there a way to continue the search and filter it even after typing spaces?

stale[bot] commented 2 years ago

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 24 hours. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again!