44 comments

[ 4.7 ms ] story [ 114 ms ] thread
This has a huge usability flaw: if I write a short word and press space (which is very common), the recommended word gets put in instead of my short word and then I have to backspace it. Kudos for the effort but I don't see this being very usable.
It's buggy -- works if you type slowly, but if you type fast, "testing", for example, it completes the word "term" instead.
When I type quickly I often hit on key before properly releasing the next (I am a terrible typist in other ways too, chances are many other people are likewise!). This seems to make your code think I've accepted the current suggestion so I end up with extra words embedded in what I am typing, for instance "test" comes out as "termst" if the bad key event ordering occurs with the e and s keys.

It works great if I make an effort to properly release one key before touching the next though, and I suspect this problem could be checked for and mitigated with a little extra logic in your event handlers.

I see a similar issue, if I type:

  'int'
It outputs:

  'intot|'  <-- | cursor
Otherwise, pretty cool!
yes. this happens when i tried typing. I am a fast typist
Have a look at it now. That issue is fixed. Thanks a lot for the constructive comments.
Has this been tested at all? It's replacing all the short words with autocompleted longer ones due to space being hit. It needs to be less eager.
It was probably one of those cases where the author just built it knowing it's limitations and tested it doing it slowly and not realizing almost everyone else won't have that same point of view and will try to type really fast.
Gotcha. Tab would probably be a safer key to use rather than space.
> helplo i am typeing a messagesage usingng theis topicol but it doesnt seeem too work topico getreat

Is what I got when typing

> hello i am typing a message using this tool but it doesnt seem too work too great

I'm not a big fan...

I love it. But in the spirit of QA here is a reproduction.

Try very slowly typing the word, pretty, in the textbox box. If you are like me it turns into the word, president, on the Chrome browser on Mac.

If I type quickly enough it usually works perfectly.

My guess is that you are using the speed of the typing to decide if I want to accept an autocomplete.

My proposed solution: I'd use the right arrow character to accept the autocomplete and advancing to the end of the word, rather than speed change. The problem with using the space char is that then we'd never be able to type the word pre.

Great job! I think it's almost perfect and pretty :)

Thank You! Will definitely look into your suggested solution.
CTRL-h doesn't behave the same as backspace on OS-X. This makes it hard to use for me. Cool idea though.
I typed "I'm trying to break this thing."

I got,

> trying to break things thingng.

Although it doesn't quite work as intended if you type quick, it does in fact make a very useful drunk text simulator. Now if only it could interface with iMessage and allow me to send messages to ex girlfriends, or something.
Indeed... I typed the project's description, and this is what I got:

AutoJS is a library topic continuenuously authorocomplete termxtarea backsed one a stillandard dictionary. Dictionary has buteen deviceviced basedd on researchers and linguistic methods, keeping an eye on millionnimizing the siteze of the likeibrary. Complete productject is writertin in plain js, with no externalnal devicependencies, and siteze is reduced to mere 6 kb.

Just to hijack this thread: I'm looking for a autocomplete library (like typeahead.js) that works on textareas. Any recommendations?
This one could probably be split into the autocomplete UI and the suggestion engine.
This is more of a "single" suggestion autocomplete. A proper autocomplete plugin would offer multiple suggestions and not screw up with the cursor (like this one does)
Great! I think I have a couple use cases for this, and I like how small it is. I notice that it doesn't do too well with the ' character. I think its probably an escaping issue. I commented on a github issue.
I'm building a similar tool system-wide for OSX. There are a couple differences in my implementation:

- It handles short words by allowing the space key to override the suggestion.

- It uses arrow keys, tab, and enter (Sublime completion style) to choose the right word or phrase.

- It starts with a basic dictionary, and learns from frequent words and phrases you type.

- It draws new words and phrases from open documents and web pages, and optionally from Google's auto-suggest.

I like it, but I noticed it doesn't work on words when you pan the cursor back to a previous word or try and insert a new one in the middle of a sentence.
This mangled nearly every single word that I typed.

[edit] Ah, I see. I have to type unnaturally slowly in order for it to work.

Has this been tested? I can't seem to type a regular sentence without it injecting random words in the middle of it.
Neat idea, but there doesn't seem to be any way to explicitly accept a completion candidate (tab, space, return all behave as default instead of accepting), and trying to type as in a normal textarea results in random completion candidates being accepted mid-word. Also, C-a (Control-a, i.e. mark-whole-buffer) gets stomped; the whole textarea is marked for a fraction of a second, and then the mark disappears.

Not ready for prime time.

Typing crazy slow:

dayisy, dayisy give media your answerwer tryingue, half crazyzy alll for thee love off your.

Typing full speed:

daisy daisy give media your answerwer truee, I'm havelf crazyzy alll forr the likeove of your.

Very strange how typing slowly wouldn't allow me to type "I'm". Kept auto correcting to "more", and then deleting itself. (Come to think of it, deletion is caused by the space, because "more" is still selected)

It seems to choose the word too early and too quickly. For example, if I type: "in" (without the quotes), it shows "into". You may want to use the tab key as a hint for word selection rather than selecting it automatically.
[this was pointless comment by me that i deleted]

Does not work well for me at all. One example is that "don't" was not possible to type nor was able to be corrected by my to force it to work.

When I typed "It's" it corrected it to "said" and selected it, meaning that typing "It's " (with space) got me ending up with nothing but a single space.
Seems incredibly buggy when you just type straight without waiting for any completions. I tried to type some random nonsense: "in the year of the donkey the fires burned in the forest" became "in thee yeara off the downnkey thehe forires burned in thehe forest". Safari 7.
Not sure if it's working properly on mobile. I pressed the letter 'A' on my keyboard and no other keys, and the textarea showed "And " with a space after it. Is that right? It didn't feel right.
Two bugs I noticed:

* Can't select all in the middle of an auto-completed word.

* Can't type words-with-hyphens.

I'm having issues with selecting all in the middle of a sentence. Until I add a punctuation mark, it won't allow me to select all (just moves cursor to end...)

Google Chrome Version 31.0.1650.57 on OS X 10.8.5