RFR: 8343956: Focus delegation API
Michael Strauß
mstrauss at openjdk.org
Mon Jul 7 04:55:23 UTC 2025
On Sun, 9 Feb 2025 22:45:14 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:
> Why doesn't it just set the delegate to whatever hoisted focus in the first place? A not entirely hypothetical `DateEntryControl` with 3 separate fields internally (with borders stripped) could have a day-month-year area (such controls were quite common before fancy date pickers). Each of the subfields could set hoist focus. Clicking on a specific subfield would put the cursor there, but focus the `DateEntryControl` as a whole.
I've added a parameter to `getFocusDelegate(Node hoistingNode)`, which indicates the node that hoisted the last focus request to the node on which `getFocusDelegate` is called. The hoisting node is not necessarily a focus delegate, it can be any descendant with the `hoistFocus` flag set.
When `getFocusDelegate(Node hoistingNode)` is called, the control can use the additional information to decide which of its children will be the focus delegate.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1632#issuecomment-2834992966
More information about the openjfx-dev
mailing list