6 ms·
AutoJS – JS library for textarea lookahead
- tzaman 13y agoThis 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.
- aviraldg 13y agoIt's buggy -- works if you type slowly, but if you type fast, "testing", for example, it completes the word "term" instead.
- dspillett 13y agoWhen 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.
- atmb4u 13y agoWill definitely look into this issue. Thanks for the suggestion.
- grandpa 13y agoThis is what happened when I tried typing the first sentence on your web site: http://i.imgur.com/jQGHwQc.png http://i.imgur.com/jQGHwQc.png
- owenjones 13y agoI see a similar issue, if I type: 'int' It outputs: 'intot|' <-- | cursor Otherwise, pretty cool!
- ankit84 13y agoyes. this happens when i tried typing. I am a fast typist
- atmb4u 13y agoHave a look at it now. That issue is fixed. Thanks a lot for the constructive comments.
- goldenkey 13y agoHas 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.
- joshmlewis 13y agoIt 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.
- goldenkey 13y agoGotcha. Tab would probably be a safer key to use rather than space.
- tokenizerrr 13y ago> 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...
- bananashake 13y agoI 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 :)
- atmb4u 13y agoThank You! Will definitely look into your suggested solution.
- maxbrunsfeld 13y agoCTRL-h doesn't behave the same as backspace on OS-X. This makes it hard to use for me. Cool idea though.
- gagege 13y agoI typed "I'm trying to break this thing." I got, > trying to break things thingng.
- jdangu 13y agodoesn't seem to work on FireFox 25.0.1 ReferenceError: AutoSuggestControl is not defined @ http://atmb4u.github.io/AutoJS/:78 http://atmb4u.github.io/AutoJS/:78
- CaveTech 13y agoAlthough 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.
- lakwn 13y agoIndeed... 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.
- captn3m0 13y agoJust to hijack this thread: I'm looking for a autocomplete library (like typeahead.js) that works on textareas. Any recommendations?
- ricardobeat 13y agoThis one could probably be split into the autocomplete UI and the suggestion engine.
- captn3m0 13y agoThis 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)
- MatthewWilkes 13y ago503 on the code for me.
- zekenie 13y agoGreat! 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.
- nathancahill 13y agoI'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.
- leke 13y agoI 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.
- mike-cardwell 13y agoThis mangled nearly every single word that I typed. [edit] Ah, I see. I have to type unnaturally slowly in order for it to work.
- phaed 13y agoHas this been tested? I can't seem to type a regular sentence without it injecting random words in the middle of it.
- aaronem 13y agoNeat 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.
- tairar 13y agoTyping 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)
- myang 13y agoIt 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.
- rossij 13y ago[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.
- mtrimpe 13y agoWhen 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.
- lobster_johnson 13y agoSeems 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.
- matthuggins 13y agoNot 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.
- gmjosack 13y agoTwo bugs I noticed: * Can't select all in the middle of an auto-completed word. * Can't type words-with-hyphens.
- j79 13y agoI'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
- ecesena 13y agoBased on this audience, I'd have tested it more on "hello world" ;) I understand there's been some effort in tuning the dictionary for size vs completeness. Can you elaborate a bit more on this point?
- bellbind 13y agoWhy can't I specify a remote dictionary of my own ? AKA: no i18n support, thank you. Why is the data mixed in with the code in the first place?
- underwater 13y agoPlease don't go adding this to your production websites. It's incredibly buggy when using any kind of non-standard input. A few examples: * IME input is broken. If I type "s" and "a" with my keyboard set to Katakana I should see "サ" and not "sア". * Adding accented characters on OS X (hold down a vowel key) doesn't do what I'd expect. Pressing "e" and selecting a variant inserts the first suggestion giving me "êven". * Entering text at the beginning of input is not possible. Trying to do so constantly moves the cursor to the end. * Spellcheck underlines disappear. Browsers won't recheck the entire input after each keystroke, just the last few words. They also stop underlining when you change the input value. This means that any incorrectly spelled words lose their highlight if not near the cursor. * There seems to be no consideration for how this will work for users who rely on a screen reader. Few of these browser and OS features expose APIs to JavaScript. You have to build your application around their behavior from the ground up. The approach used by this script of mutating the value and modifying selection is completely broken.
- underwater 13y agoThis effect is better achieved by using two nodes. At Facebook we have the main input positioned over a node that shows the same content with the suffix appended. This is the same technique we use to show highlighted names in the comment field.
- uptown 13y agoSeems impossible to press CTRL-A to select-all in order to clear what's been typed.
- atmb4u 13y agoworking on it. Thanks a lot for the bug report.
- gambler 13y agoIt reminds of JS-based spellcheckers that plagued many web apps in late 90s. This kind of stuff simply cannot be implemented properly without browser integration. What if I am using a Latin-base language that is not English? Besides, auto-complete should be explicitly accepted, not showed into the box after some unrelated keystrokes. If I type "h", pressing backspace should delete what I just typed, not "ave".