AutoJS icon indicating copy to clipboard operation
AutoJS copied to clipboard

No keyboard shortcut for accepting suggestions

Open cstuder opened this issue 12 years ago • 13 comments

Neither Space nor Enter work, with Tab the focus goes outside the input box.

If I click on the suggestion, it gets inserted, but the text cursor jumps to the character closest to the mouse pointer.

cstuder avatar Nov 25 '13 15:11 cstuder

You can press your right arrow key though.

julianwachholz avatar Nov 25 '13 15:11 julianwachholz

Right arrow key breaks the typing flow. Space is probably the least intrusive, as Enter and Tab both have their default form actions. By using space though you'd also need to add ESC for canceling the current suggestion when you really want to enter a space right now.

yyx990803 avatar Nov 25 '13 16:11 yyx990803

I always liked tab to accept IF a suggestion is currently offered.

TheSisb avatar Nov 25 '13 17:11 TheSisb

Just tried the demo, really great idea! Will be using a Swedish dictionary on a project.

As mentioned, space would be the most natural since Tab and Enter is system defaults already.

tmikaeld avatar Nov 26 '13 09:11 tmikaeld

Good plugin, but +1 to using space and ditching right arrow altogether. There is no way to make typing easy using right-arrow for auto-complete acceptance.

impressivewebs avatar Nov 26 '13 13:11 impressivewebs

:+1: for space bar to insert word instead of right arrow key

arkmediastudio avatar Nov 26 '13 17:11 arkmediastudio

+1 for tab to insert suggested word.

Danita avatar Nov 28 '13 12:11 Danita

Tab is already used to be able to navigate a webpage with only keyboard, using that would break it.

It's a usability no-no.

tmikaeld avatar Nov 28 '13 12:11 tmikaeld

@cstuder We're talking about an autocompleting textarea, which is not a common pattern for the web but it is for the desktop (think IDEs for example). Please note I'm not advocating hijacking the TAB key for the autocomplete in all cases; I'm just suggesting using it to insert a word when there is already a suggestion in place, a second TAB keypress would tab out the textarea as it normally does.

For further example, please note how this very Github comment textarea works:

  1. Type @
  2. Press Tab or Enter (the first name is autocompleted)
  3. Press Tab once more (focus goes to Comment button outside the textarea)

Danita avatar Nov 28 '13 12:11 Danita

This ticket is having so many comments and I see so much on interest for auto complete on space, tab and enter. @Danita: When thinking of it from a usability point-of-view, we can't add @ or some other marker at every word for auto-completion. After going through the comments, I found that space would be an ideal choice. It needs some architectural changes to accommodate caching of suggestions for previous keystroke, as space clears it at the moment. Strongly considering this for the next major release.

atmb4u avatar Dec 03 '13 07:12 atmb4u

@atmb4u I feel that having English as a second language is playing tricks on me. I did not meant to use @ or any other marker at every word for autocompletion. I merely used it in the example to trigger the Github autocomplete and to illustrate what happens next when you use the Tab or Enter key after you have a suggestion: the first Tab keypress autocompletes the suggestion if there is one and then a second Tab keypress tabs away from the field.

If I have some time I'll post an example of what I mean in case it's still not clear enough.

Danita avatar Dec 03 '13 14:12 Danita

Having said that, I feel that space could pose a usability problem if the user is trying to type a word that is in itself contained in a longer suggested word, for example even and event.

Danita avatar Dec 03 '13 14:12 Danita

:+1: awesome observation @Danita , we definitely have to consider this thing while further developing. In such a case, we might have to think of Tab.

atmb4u avatar Dec 03 '13 16:12 atmb4u