Skip to content
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

Stop searching once selection is made if allowSpaces is true. Seen in version 5.1.1 and higher. #606

Open
and-megan opened this issue Feb 4, 2021 · 9 comments

Comments

@and-megan
Copy link

It looks like this bug was introduced in version 5.1.1. I fiddled around with the version in my codepen link and everything works as expected in version 5.1.0 and then breaks in subsequent versions.

How can we reproduce this bug?
1. Set allowSpaces: true in configuration
2. Attach tribute to a text area
3. Search for a value, e.g. type @phil
4. Select user, e.g. Phil Heartman, from list
5. Continue typing, e.g. "is not the famous voice actor"
6. Tribute continues searching in values using text typed after the replaced selection text, i.e. searches values for "Phil Heartman is not the famous voice actor"

What did you expect to happen?
Tribute stops trying to match typed input against values once a selection is made.

What happened instead?
Tribute attempts to match typed string until another trigger character is typed.

Link (jsfiddle/plunkr/codepen) or Screenshot:
Codepen: https://codepen.io/andmegan101/pen/qBqOYyN

@and-megan and-megan changed the title Stop searching once selection is made if allowMentions is true. Seen in version 5.1.1 and higher. Stop searching once selection is made if allowSpaces is true. Seen in version 5.1.1 and higher. Feb 4, 2021
@greenfork
Copy link

I can reproduce, same problem

@gurgeous
Copy link

Can confirm - this blocks allowSpaces from being used

@tomek-swienty
Copy link

Confirmed :(

@nseb
Copy link

nseb commented Jan 22, 2022

+1

@MoritzGiessmann
Copy link

Same. Did anyone come up with a solution yet?

@datherton15
Copy link

Same. Any timeline on resolution?

@MoritzGiessmann
Copy link

I did come up with a solution, but I had to change the whole tribute.js and introduce a new state that resolves after inserting a suggestion. Not elegant and not worth posting.

@datherton15
Copy link

I did come up with a solution, but I had to change the whole tribute.js and introduce a new state that resolves after inserting a suggestion. Not elegant and not worth posting.

@MoritzGiessmann Nice...elegant or not, any port in a storm. Could you publish your version of the tribute.js? I have been tracing the code and trying to figure out best method to adjust /implement a solution but again, just logging at this point.

@datherton15
Copy link

datherton15 commented Mar 10, 2023

Doing comparison between versions 5.1.0 and 5.1.1 points to issue with line 1452 or essentially the "<li>No Match Found!</li>" line. Resetting to "" works;
In version 5.1.3, if do search for "<li>No Match Found!</li>" and replace with "" it works BUT

  • still get "Loading" display
  • obviously no "No Match Found!" will appear on search.
    Need to figure out case or scenario when allowSpaces is true for these. Will see what can figure out but if anyone quicker than I figures out, pass on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants