Sync browser devtools preference on surface focus loss

This commit is contained in:
austinpower1258 2026-03-17 16:32:59 -07:00
parent fabcb06891
commit 79fade5add

View file

@ -536,6 +536,13 @@ struct BrowserPanelView: View {
panel.invalidateAddressBarPageFocusRestoreAttempts()
hideSuggestions()
setAddressBarFocused(false, reason: "panelFocus.onChange.unfocused")
// Surface switches in split layouts can keep the browser visible, so
// `isVisibleInUI` never flips to false. Sample the real inspector
// state when focus leaves the panel as well, otherwise an X-close can
// leave the persisted DevTools intent stale until the next reattach.
DispatchQueue.main.async {
panel.syncDeveloperToolsPreferenceFromInspector()
}
}
syncWebViewResponderPolicyWithViewState(
reason: "panelFocusChanged",