diff --git a/crates/ui-contract/src/runtime/focus/nav.rs b/crates/ui-contract/src/runtime/focus/nav.rs index 293d504d3f..5ebfead60f 100644 --- a/crates/ui-contract/src/runtime/focus/nav.rs +++ b/crates/ui-contract/src/runtime/focus/nav.rs @@ -809,7 +809,8 @@ pub(super) fn initial_focus(state: &mut State, frame: u64) -> Vec { let pick = match policy.initial { Initial::First => entry.as_ref(), Initial::Default => stops.iter().find(|rec| rec.stop.default).or(entry.as_ref()), - Initial::FirstField => stops.iter().find(|rec| rec.stop.text).or_else(|| stops.iter().find(|rec| rec.stop.default)), + // Read-only text is press-only (Tab passes over it), so it is not the field a dialog opens on. + Initial::FirstField => stops.iter().find(|rec| rec.stop.text && !rec.stop.press_only).or_else(|| stops.iter().find(|rec| rec.stop.default)), Initial::Key(name) => stops.iter().find(|rec| rec.stop.name == Some(name)), _ => None, }; diff --git a/crates/ui-contract/src/runtime/focus/policy.rs b/crates/ui-contract/src/runtime/focus/policy.rs index 7a8acfed7c..955342f8be 100644 --- a/crates/ui-contract/src/runtime/focus/policy.rs +++ b/crates/ui-contract/src/runtime/focus/policy.rs @@ -12,7 +12,8 @@ pub enum Initial { Keep, /// The scope's first stop. First, - /// The scope's first text or number field, else its default stop, else nothing: a dialog's default. + /// The scope's first editable text or number field (read-only text is passed over), else its default stop, else + /// nothing: a dialog's default. FirstField, /// The stop registered as the default. Default,