Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from Enter to TAB for mentions autocomplete with tribute #16735

Closed
brunob opened this issue Aug 19, 2021 · 5 comments
Closed

Switch from Enter to TAB for mentions autocomplete with tribute #16735

brunob opened this issue Aug 19, 2021 · 5 comments
Labels
topic/ui Change the appearance of the Gitea UI

Comments

@brunob
Copy link

brunob commented Aug 19, 2021

Hi, since #3136 we have nice autocomplete of mentions powered by tribute.js but we miss the native behavior or tribute (and major part of autocomplete systems) when we have to validate an item by pressing ENTER key instead of TAB one.

I've tested it on tribute demo page https://zurb.github.io/tribute/example/ and TAB works well for selecting an item in the autocomplete dropdown. I've also tested on a gitea issue page after disabling SimpleMDE (ref #10099) and it works well with TAB key.

I found that the TAB key is catched by SimpleMDE/CodeMirror and that the ENTER key behavior is handled here https://github.com/go-gitea/gitea/blob/main/web_src/js/index.js#L1751

FTR, the CodeMirror author says that this tab focus/catching is a bad choice :

At some point, I let people convince me that the editor should override tab by default. I think that was a bad call, now, but won't be able to change it until the next major release.

codemirror/codemirror5#5444

What do you think of switching from ENTER to TAB key in https://github.com/go-gitea/gitea/blob/main/web_src/js/index.js#L1751 as we can get mentions working like any other platform ?

PS : this also can be done with a specific class on text fields cf codemirror/codemirror5#5444

@lunny lunny added the topic/ui Change the appearance of the Gitea UI label Aug 19, 2021
@nmrugg
Copy link

nmrugg commented Oct 19, 2021

This would be great. It's disorienting that tab does not work.

@brunob
Copy link
Author

brunob commented Oct 20, 2021

Do you want/need a PR for that ?

@wxiaoguang
Copy link
Contributor

The tribute popup has been refactored.

@brunob
Copy link
Author

brunob commented Apr 26, 2023

@wxiaoguang what do you mean by tribute popup ? Do you have any reference to provide ?

@wxiaoguang
Copy link
Contributor

try.gitea.io

Replace tribute with text-expander-element for textarea #23985

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

No branches or pull requests

4 participants