jabref icon indicating copy to clipboard operation
jabref copied to clipboard

ESC should close the dialog

Open koppor opened this issue 2 years ago • 3 comments

JabRef version

Latest development branch build (please note build date below)

Operating system

Windows

Details on version and operating system

No response

Checked with the latest development build

  • [X] I made a backup of my libraries before testing the latest development version.
  • [X] I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Open preferences
  2. Select "Citation key generator"
    grafik
  3. Press ESC
  4. nothing happens
  5. Select line "Article" in the table
  6. Press ESC
  7. Nothing happens

Expectation: at step 4 and 7, the dialog should close

Appendix

...

Log File
Paste an excerpt of your log file here

koppor avatar Jun 06 '22 18:06 koppor

All tabs in the preferences need to be checked for this behavior. External file tab, for example, works. Journal abbreviations not.

Siedlerchr avatar Jun 06 '22 18:06 Siedlerchr

Same for the error log

koppor avatar Jun 06 '22 19:06 koppor

Might be related https://github.com/JabRef/jabref/issues/7392#issuecomment-902222582

HoussemNasri avatar Jun 07 '22 23:06 HoussemNasri

JabRef 100.0.0 Windows 11 10.0 amd64 Java 18.0.2.1 JavaFX 19+11

When testing this issue - it appears to be the case that if I select any tab (even the General tab that is already selected when the dialog opens) then the ESC button will not close the dialog as expected. This issue appears to be more 'newcomer-friendly' than the previous issue I selected. If possible, I would like to have it assigned to me so that I can attempt to resolve this bug.

sjb-ch1mp avatar Oct 16 '22 09:10 sjb-ch1mp

@sjb-ch1mp Thanks for taking a look! There was also recently another related issue to the use of the ENTER buton https://github.com/JabRef/jabref/pull/9225 Maybe that helps you

Siedlerchr avatar Oct 16 '22 10:10 Siedlerchr

Partially fixed by @sjb-ch1mp in #9268 .

A different strategy might be needed to address it for all ListViews. Perhaps https://stackoverflow.com/a/66878882 can be useful.

k3KAW8Pnf7mkmdSMPHz27 avatar Oct 21 '22 19:10 k3KAW8Pnf7mkmdSMPHz27

@k3KAW8Pnf7mkmdSMPHz27 Thanks so much for your feedback! I was under the impression that I had tested the other ListViews that appeared in the different menus, but I clearly was not very thorough because I immediately found more that did not respect the CLOSE event, for example:

Options > Preferences > Citation key generator > Key patterns Options > Preferences > Journal abbreviations > Journal abbreviations Library > Library properties > Citation key patterns

Working under the hypothesis that the event is being consumed before it can reach the ListView component - I implemented an EventFilter in the BaseDialog class that specifically listens for the CLOSE event during the event capturing phase. This appears to have worked for all ListViews in all dialogs (as opposed to just the main Preferences tabs).

I have implemented this solution in #9275.

sjb-ch1mp avatar Oct 22 '22 00:10 sjb-ch1mp

ESC should not close the dialog of a field is focused. Then, just the field should be left. Example:

image

Pressing ESC when the cursor is in the search field, ESC should clear the search - and then leave the cursor in the field. - A second ESC press can then close the dialog.

koppor avatar Oct 25 '22 19:10 koppor