meteor-autocomplete icon indicating copy to clipboard operation
meteor-autocomplete copied to clipboard

Autocomplete filter only matches from the last token to the cursor position.

Open mizzao opened this issue 11 years ago • 0 comments

For example, in the demo if the text and cursor is

@aa|aa

The expected behavior would be to only show the aaaa record, but the current behavior is to show all strings starting with aa. This was copied from the original behavior in jquery-sew which looks for the string from the last token occurrence to the current cursor position, which is then passed to the rule regexes for processing.

Although the unexpected behavior from this rarely manifests in practice, a smarter way to do it would be to search up to the first word boundary after the cursor (or even a custom separator as proposed in this commit) and do the autocomplete as normal. However, I don't see a straightforward way to doing this via regexes without some unnecessarily complicated logic.

This issue was moved out of the README in this commit.

mizzao avatar May 14 '14 05:05 mizzao