tribute icon indicating copy to clipboard operation
tribute copied to clipboard

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

Open and-megan opened this issue 3 years ago • 9 comments

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 avatar Feb 04 '21 00:02 and-megan

I can reproduce, same problem

greenfork avatar May 11 '21 07:05 greenfork

Can confirm - this blocks allowSpaces from being used

gurgeous avatar Jun 23 '21 22:06 gurgeous

Confirmed :(

tomek-swienty avatar Jul 27 '21 09:07 tomek-swienty

+1

nseb avatar Jan 22 '22 23:01 nseb

Same. Did anyone come up with a solution yet?

MoritzGiessmann avatar Nov 08 '22 14:11 MoritzGiessmann

Same. Any timeline on resolution?

datherton15 avatar Feb 26 '23 22:02 datherton15

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 avatar Feb 26 '23 22:02 MoritzGiessmann

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 avatar Feb 26 '23 22:02 datherton15

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.

datherton15 avatar Mar 10 '23 13:03 datherton15