As also discussed back then in the mailing list, there are weird issues around 
gaining focus when a `Control` is not focus traversable but got a click event.

- Some Controls do not call `requestFocus()` when they are not focus 
traversable and receive a mouse click
- It is very inconsistent which Controls do it and which do not. Sometimes, 
just a part of a `Control` will request focus, while another one will not
- Manually calling `requestFocus()` always works

It seems like there is a misconception between beeing not focus traversable and 
not requesting focus. The focus traversable property should only affect 
keyboard navigation really. A mouse click should always request a focus.

Check the Ticket for a reproducer with all `Control`s and a short list which 
Controls do not behave (and which do).

This PR removes the pattern that was wrongly used in some `Control`s.
From:

    if (getNode().isFocusTraversable()) {
        getNode().requestFocus();
    }

To:

    getNode().requestFocus();

-------------

Commit messages:
 - 8379942: Some non focus-traversable Controls do not request focus when 
clicking on it

Changes: https://git.openjdk.org/jfx/pull/2106/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=2106&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8379942
  Stats: 94 lines in 18 files changed: 19 ins; 36 del; 39 mod
  Patch: https://git.openjdk.org/jfx/pull/2106.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/2106/head:pull/2106

PR: https://git.openjdk.org/jfx/pull/2106

Reply via email to