element-web icon indicating copy to clipboard operation
element-web copied to clipboard

Pressing "Enter" when autocompleting should autocomplete, not send message

Open lampholder opened this issue 9 years ago • 5 comments

Maybe it should do that? I found its just sending the message a bit surprising.

lampholder avatar Aug 01 '17 10:08 lampholder

doesn't look like intended? it should confirm first just in case the user wants to extend the message with the picked suggestion.

sr229 avatar Aug 02 '17 13:08 sr229

I think it makes sense to have enter cause the completion to be inserted.

lukebarnard1 avatar Aug 07 '17 08:08 lukebarnard1

I'd say this is more than a "perhaps". The auto-complete pop-up has keyboard grab for arrow keys and Esc; this strongly implies that "Enter" also applies to the pop-up, not the message field.

Additionally:

  • sending the message on Enter is not easily/fully reversible (AFAICS - redactions still show up as redacted)
  • send on Enter (with the pop-up shown) is only useful for end-of-message completions. Mentions are frequently going to be at the beginning of the message, and emoji will probably be only <= 50% of the time at the end of the message. The additional work to send if "Enter" meant "insert" would just be pressing Enter twice - not a huge burden
  • other typed characters (A-z, 0-9, space etc.) could still imply "insert" if desired, since they don't have confused semantics. Though arguably requiring an explicit "Enter" even then would allow the user to just ignore the auto-complete pop-up if they don't actually intend to insert a mention, emoji etc.

smithfred avatar Dec 09 '17 14:12 smithfred

I did a thing to fix this but it makes #4872 worse as :p [RETURN] yields 🐷

t3chguy avatar Dec 09 '17 23:12 t3chguy

As laid out above, "confirm autocomplete on enter" seems to make more sense than "send partial message on enter". It also feels more intuitive to me. This has been bugging me for a while so here's a (very straightforward) pull request for it: https://github.com/matrix-org/matrix-react-sdk/pull/2968

(Note: the last PR on this thread from late 2017, not fully functional, and then closed, so I decided I could probably safely go ahead with mine)

npny avatar May 14 '19 12:05 npny