webscopeio / react-textarea-autocomplete

📝 React component implements configurable GitHub's like textarea autocomplete.
MIT License
454 stars 80 forks source link

Show popup at a new line when afterWhitespace is set to true #147

Closed teilzeitgeist closed 5 years ago

teilzeitgeist commented 5 years ago

Hey! Is it possible to trigger the autocomplete also on a new line when afterWhitespace is set to true?

Steps to reproduce:

  1. Hit enter
  2. Type @

https://codesandbox.io/embed/2v6q1rqry0

jukben commented 5 years ago

Hey!

Yep. Sorry about that, another bug. We should look for any white character not just for " ".

Reference: https://github.com/webscopeio/react-textarea-autocomplete/blob/master/src/Textarea.jsx#L764

/\s/.test(...) should be enough

Do you want to send a PR? 🙏

teilzeitgeist commented 5 years ago

Sorry for the delay ... I've created a PR with your above mentioned solution and it works like a charm 👍

jukben commented 5 years ago

Awesome! Released as 4.3.5! 🚀 Thanks!