-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tribute container does not reopen after searching for a non-existing value #385
Comments
Any progress with that? |
@hyojin, are you planning to work on it soon? |
@NitzanShifrin Hi, I did quickly go through the code and it seems it's intended behavior (at least with the current code). Unfortunately, I don't know the background of this 🤔 |
I got around this with this code selectTemplate: function (item) {
if(item) {
return '@' + item.original.name;
} else {
// required to prevent lockup and console error when pressing enter/tab on no match found
return '@' + this.current.mentionText;
}
},
noMatchTemplate: function() {
return '<li>No Match Found!</li>';
}, change selectTemplate's first return to whatever you were returning before. |
@mxgl Should we update the default |
That's what I do It creates a scenario where typing Edit: it seems this doesn't erase the mention, but rather prevents the console error saying that the item doesn't exist if you press Also, having the noMatchTemplate defined by default keeps the menu open the entire time, allowing backspacing back to a search with results to function more smoothly! |
Can you make it return
In case there's a different trigger. |
Done! |
@mrsweaters Sorry, I really appreciate the effort you put on this library but this did not fix the main bug. The problem is that the current behaviour is inconsistent when the noMatchTemplate returns an empty string (which is a requirement in my case, not to show the noMatchTemplate). |
@lcwalther is there a reason an empty noMatchTemplate is required? You could try
|
@mxgl's workaround seems to work. I'll add that to the docs. |
@mxgl @mrsweaters I tried it, but with this an empty list is shown instead of nothing at all, which is what I need in my case. |
Could you explain your use case a little bit more? Why do you need nothing rendering? You could add a class to it and set |
What if we add a class to the |
Sorry for getting back to you so late @mrsweaters |
Looking forward to this, too! |
Hi, I still have some issues with this.
codepen: Any other way to get this to work? |
How can we reproduce this bug?
Trigger the tribute component, e.g. by pressing "@"
Type in a letter combination that exists in the values array, e.g. "Jor". "Jordan Hemphrey" is shown.
Add an "f" so that you typed in "Jorf" which is a combination that does not exist in the values array. The tribute container disappears.
Press backspace to delete the "f", so that only "Jor" is displayed.
What did you expect to happen?
The tribute container should reappear, showing "Jordan Hemphrey", basically showing all available options starting with "Jor".
What happened instead?
The tribute container does not reopen. The user has to delete the whole value "@Jor", even including the "@" symbol, and type it in again to retrigger the tribute container and search for another value.
Link (jsfiddle/plunkr/codepen) or Screenshot:
The text was updated successfully, but these errors were encountered: