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

Starting an @mention but not selecting an option will push cursor to end of text. #419

Open
joeldaigle05 opened this issue Jul 22, 2016 · 6 comments

Comments

@joeldaigle05
Copy link

Steps:

  • In the middle of a sentence start an @mention.
  • Do not select a result, just keep typing with spaces.
  • When mentions ends because of no results, cursor is pushed to the very end of your sentence instead of keeping cursor in the middle of the sentence.
@DustinWehr
Copy link

Are you using the component in a contenteditable? I am, and get this bug as well. It doesn't always happen, however.

@joeldaigle05
Copy link
Author

Yes, I am using the component inside and editor contenteditable. I am able to reproduce this issue very frequently on the At.js demo page.

cursorjumptoend

@willycamargo
Copy link

I think it is related with issue #393 . @leb2dg resolves it on pull request #394

But @ichord didn't review it yet

@laurenbarker
Copy link
Contributor

@joexanderson @willycamargo , #423 (the new #394) was merged! Last I checked it hasn't been released but you can pin to the commit and get the fix 🎉

@DustinWehr
Copy link

I still have this issue after #423. It's "fixed" if I disable the line after the one call to afterMatchFailed in the compiled js:

this._setRange("after", this._unwrap($query.text($query.text()).contents().first()));

@DustinWehr
Copy link

DustinWehr commented Sep 28, 2016

Ah, but a better solution is to provide an implementation of afterMatchFailed that returns false. Then no need to modify the source.

For reference, my call to atwho looks like

$elem.atwho({
            at: "\{",
            data: items,
            callbacks : {
                afterMatchFailed: (at, el) => { return false; }
            }
        });

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

No branches or pull requests

4 participants