diff --git a/core/src/widget/operation/focusable.rs b/core/src/widget/operation/focusable.rs index 49c574c4..44c9d647 100644 --- a/core/src/widget/operation/focusable.rs +++ b/core/src/widget/operation/focusable.rs @@ -285,15 +285,15 @@ pub fn is_focused(target: Id) -> impl Operation { _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation), ) { + if self.is_focused.is_some() { + return; + } + operate_on_children(self); } fn finish(&self) -> Outcome { - if let Some(is_focused) = &self.is_focused { - Outcome::Some(*is_focused) - } else { - Outcome::None - } + self.is_focused.map_or(Outcome::None, Outcome::Some) } }