mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-20 09:09:35 +02:00
fix(tabs): Escape from a flat-rail web-tab menu returns focus to the row (#582 merge-time fix)
#582 made the web-tab actions menu reachable on the flat rail (ContextMenu or Shift+F10 on a role=tab row), but closeTabGroupMenu only looked for a tree item or a Focus shortcut, so Escape dropped focus to <body>. A `.session-tab` trigger now counts too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
5d31e42db0
commit
34b867025d
1 file changed
+3
-2
@@ -8161,10 +8161,11 @@ class CodemanApp {
|
||||
menu.remove();
|
||||
if (!restoreFocus) return;
|
||||
// The trigger may have been re-rendered while the menu was open; find the
|
||||
// live tree item by identity.
|
||||
// live tree item by identity. A flat-rail row (a web tab's menu opens there
|
||||
// too, from ContextMenu or Shift+F10) is a `.session-tab` with role=tab.
|
||||
const rail = this.$('sessionTabs');
|
||||
const item =
|
||||
(trigger?.isConnected && (trigger.closest('[role="treeitem"]') || trigger.closest('.tab-focus-item'))) ||
|
||||
(trigger?.isConnected && trigger.closest('[role="treeitem"], .tab-focus-item, .session-tab')) ||
|
||||
[...(rail?.querySelectorAll('[role="treeitem"]') || [])].find((el) => this._tabTreeIdentity(el) === identity);
|
||||
item?.focus();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user