UI: Fix focus reconciliation for context root

This commit is contained in:
Luke Street
2026-05-05 14:17:57 -06:00
parent ccd2bdbaac
commit 5ca0a2ba06
+2 -1
View File
@@ -103,7 +103,8 @@ void update() noexcept {
// If no documents have focus, explicitly focus the top one
if (auto* context = aurora::rmlui::get_context();
context != nullptr && context->GetFocusElement() == nullptr)
context != nullptr && (context->GetFocusElement() == nullptr ||
context->GetFocusElement() == context->GetRootElement()))
{
for (auto& doc : std::views::reverse(sDocuments)) {
if (!doc->closed() && !doc->pending_close() && doc->focus()) {