Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix update_focus_chain pass #595

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions masonry/src/passes/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,6 @@ fn update_focus_chain_for_widget(
widget_children: widget.children.reborrow_mut(),
};
widget.item.lifecycle(&mut ctx, &LifeCycle::BuildFocusChain);

if !state.item.is_disabled {
parent_focus_chain.extend(&state.item.focus_chain);
}
}
state.item.update_focus_chain = false;

Expand All @@ -534,6 +530,10 @@ fn update_focus_chain_for_widget(
},
);

if !state.item.is_disabled {
parent_focus_chain.extend(&state.item.focus_chain);
}

// had_focus is the old focus value. state.has_focus was replaced with parent_ctx.is_focused().
// Therefore if had_focus is true but state.has_focus is false then the widget which is
// currently focused is not part of the functional tree anymore
Expand Down