Popups: OpenerEscape names the focus eligibility it adds to

A popover opens with Initial::Keep, whose opener focus_in_layer does not count as
inside the layer, so Escape reaches it only through OpenerEscape. A KeepAnchor
scope already counts its opener; its doc now says which is which.
This commit is contained in:
skylartaylor committed 2026-11-25 18:33:31 +01:00
1 parent 4e7b9d8aba
commit 85c1c7dcc7
1 file changed
+6
@@ -28,6 +28,12 @@ pub enum Outside {
/// What an untaken Escape at a popup's explicit registered opener does. This does not make the opener a member
/// of the popup's focus scope or change its Tab order; the focus policy's `CancelRule::Ignore` still wins.
///
/// `Default` is the focus policy's own eligibility: an untaken Escape reaches the top layer while the focus is in its
/// scope, in no layer at all, or on the opener of a scope that opens with `Initial::KeepAnchor`
/// (`focus::focus_in_layer` counts that opener). A popover opens with `Initial::Keep`: the focus stays on its opener,
/// which may sit in another layer, so with `Default` the Escape is that layer's and the popover stays open. `Close` and
/// `CloseAndBlur` are that popover's opt-in.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
#[non_exhaustive]
pub enum OpenerEscape {