diff --git a/consumer/src/node.rs b/consumer/src/node.rs index 8d43cc2e5..8baf8f30a 100644 --- a/consumer/src/node.rs +++ b/consumer/src/node.rs @@ -47,8 +47,12 @@ impl<'a> Node<'a> { self.tree_state.focus_id() == Some(self.id()) } + pub fn is_focused_in_tree(&self) -> bool { + self.tree_state.focus == self.id() + } + pub fn is_focusable(&self) -> bool { - self.supports_action(Action::Focus) + self.supports_action(Action::Focus) || self.is_focused_in_tree() } pub fn is_root(&self) -> bool { diff --git a/consumer/src/tree.rs b/consumer/src/tree.rs index 850ae470a..85082482f 100644 --- a/consumer/src/tree.rs +++ b/consumer/src/tree.rs @@ -16,7 +16,7 @@ use crate::node::{Node, NodeState, ParentAndIndex}; pub struct State { pub(crate) nodes: ChunkMap, pub(crate) data: TreeData, - focus: NodeId, + pub(crate) focus: NodeId, is_host_focused: bool, }