RFR: 8313956: focusWithin on parents of a newly-added focused node is not updated [v4]
Michael Strauß
mstrauss at openjdk.org
Fri Aug 18 21:51:36 UTC 2023
On Fri, 18 Aug 2023 21:25:38 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
> thank you for explanations!
>
> one more question: suppose, prior to removal of the Pane it contained a focused (Scene.focusOwner) Node.
>
> 1. once the Pane is removed, what happens to Scene.focusOwner?
There's quite a bit of logic happening. `Scene.focusCleanup()` is a good starting point. Basically, we need to find a new focus owner if the old focus owner is removed from the scene graph.
> 2. once the Pane is added back, would we have an inconsistent state in respect to Scene.focusOwner (if some other node requested focus in the mean time, wouldn't we have two focused nodes?)
It's not inconsistent, but it wouldn't be the same state as before. The `focused` state would remain, but `Scene.focusOwner` would not be restored to the previous node. That part of the focus story hasn't changed with the introduction of `focus-visible` and `focus-within`.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1210#discussion_r1298887190
More information about the openjfx-dev
mailing list