jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Left and right keys do not work in the search bar

Open iTao8 opened this issue 9 years ago • 7 comments

JabRef 4.0-dev--snapshot--2017-08-06--master--b7743c4d7 Mac OS X 10.11.6 x86_64 Java 1.8.0_144

Steps to reproduce:

  1. input "LeftRight" in the search bar
  2. try to use left and right keys so that we can move the cursor and insert a space between "t" and "R"
  3. the left and right keys do not move the cursor

iTao8 avatar Aug 07 '17 10:08 iTao8

Also confirmed under Windows. The left/right keys move the focus away from the field. I think this is not really related to the keybindings, but more a focus problem. @tobiasdiez You looked into that focus problem, any idea why the focus does not stay in the field?`

Siedlerchr avatar Aug 07 '17 20:08 Siedlerchr

I'll be so brave and add this to the 4.0 milestone as one of the things we can fix before the final release.

lenhard avatar Aug 10 '17 08:08 lenhard

Even the "Mouse down" event focuses the next button. This actually renders the autocompletion useless since one cannot select the next item.

tobiasdiez avatar Aug 24 '17 15:08 tobiasdiez

Could adding an else { e.consume(); } here fix this? https://github.com/JabRef/jabref/blob/2abf651271db920204011f6dd4253b916467d655/src/main/java/org/jabref/gui/search/GlobalSearchBar.java#L197-L212 Since i'm not a 100% certain how the searchbar should behave i don't know what to look for when testing, but i didn't see anything out of the ordinary in a quick GUI test.

snisnisniksonah avatar Aug 25 '17 22:08 snisnisniksonah

Tested it. Works. Have a slight other issue (see https://github.com/koppor/jabref/issues/252), but not a blocker.

koppor avatar Sep 03 '17 09:09 koppor

And another one, which is not directly related to this PR: https://github.com/koppor/jabref/issues/253

koppor avatar Sep 03 '17 09:09 koppor

I did some research onto this specific issue and it seems like the problem is here the JToolBar which has an implicit KeyListener registered for the arrow keys. So I guess when we rework the toolbar the workaround should be no longer necessary https://stackoverflow.com/a/17049479/3450689

Siedlerchr avatar Sep 08 '17 16:09 Siedlerchr