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

Fix editing tags #6

Open
nikonikolov opened this issue Jul 24, 2018 · 1 comment
Open

Fix editing tags #6

nikonikolov opened this issue Jul 24, 2018 · 1 comment

Comments

@nikonikolov
Copy link

Hi, I really like this project and would love to see more frequent updates.

There is a bug related to the tags which is extremely annoying and kills productivity. When I edit the tags for a paper, the drop down menu with tag suggestions seems to be constantly on (except if the paper does not have all available tags). Furthermore, a tag from this drop-down menu is always selected and pressing Enter actually inserts the selected tag from the drop-down menu instead of saving the currently input tags. I am willing to help fix this, but it will be great if you give me some directions where to start (I know JS, but no PHP). Thanks!

@MicaelCarvalho MicaelCarvalho self-assigned this Jul 25, 2018
@MicaelCarvalho
Copy link
Member

With 40a5699 I prevented autocompletion when no match is found. However, this issue goes deeper than a simple fix. The behavior of the enter key (13) seems to be coded inside one of the frameworks we use, and I couldn't quickly identify where.

I can give you some directions if you plan on attacking this:

  • The autocompletion is dealt with here:

    DjLu/js/djlu.js

    Line 276 in 40a5699

    el.attr("autocomplete", "off").typeahead("destroy").typeahead({
  • The keydown and keypress events cannot block the #13 key, unless some clever trick is adopted to prevent the event from triggering the dropdown events;
  • This whole thing is related to bootstrap-3-typeahead (https://github.com/bassjobsen/Bootstrap-3-Typeahead). There seems to be no mechanism to disable the return key — the autoSelect option could be a dirty fix, but it would also get in the way of normal usage, therefore it would not be fit for an official commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants