mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-14 03:56:55 +03:00
fix(app): keep the mobile drawer open while a session loads (#59427)
This commit is contained in:
committed by
GitHub
Unverified
parent
bbd853506e
commit
50ea8d5003
@@ -62,8 +62,14 @@ export function createSessionComposerController(input: {
|
||||
if (!editor?.isConnected || !region.showComposer() || region.child() || dialog.active) return
|
||||
const active = document.activeElement
|
||||
|
||||
// A control chosen while the session was loading owns focus now.
|
||||
if (active && active !== document.body && active !== editor && !active.matches("[data-titlebar-tab-link]"))
|
||||
// A control chosen while the session was loading owns focus now. The tab link that opened the session
|
||||
// passes focus on, unless it sits in a dialog, such as the mobile tabs drawer reopened before the composer.
|
||||
if (
|
||||
active &&
|
||||
active !== document.body &&
|
||||
active !== editor &&
|
||||
(!active.matches("[data-titlebar-tab-link]") || active.closest('[role="dialog"]'))
|
||||
)
|
||||
return
|
||||
editor.focus({ preventScroll: true })
|
||||
setCursorPosition(editor, adapter.state.cursor() ?? promptLength(adapter.state.current()))
|
||||
|
||||
Reference in New Issue
Block a user