From fc68985b2df1661e3b0cea62ea2ae62f844fda80 Mon Sep 17 00:00:00 2001 From: Terry Yiu Date: Thu, 10 Sep 2026 08:55:05 +0300 Subject: [PATCH] Fix ToolbarReader console warning on macOS currency sheet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Combining .searchable, .toolbar, and .navigationTitle on the same List triggered "Update ToolbarReader tried to update multiple times per frame" every time the sheet's first presentation animated in. Moving .searchable onto the NavigationStack instead — separate from the .toolbar/.navigationTitle chain on the List — avoids it. Reproduced and confirmed fixed via the unified log (Console shows the same warning under com.apple.SwiftUI:Invalid Configuration); the sheet, search field, and currency list all still render correctly. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy --- iosApp/iosApp/CurrencyPickerSheet.swift | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/iosApp/iosApp/CurrencyPickerSheet.swift b/iosApp/iosApp/CurrencyPickerSheet.swift index bfc8780..995b61e 100644 --- a/iosApp/iosApp/CurrencyPickerSheet.swift +++ b/iosApp/iosApp/CurrencyPickerSheet.swift @@ -44,10 +44,6 @@ struct CurrencyPickerSheet: View { } } } - .searchable( - text: $searchQuery, - prompt: IosLocalizationKt.localizedString(resource: MR.strings.shared.search_currencies_placeholder) - ) .navigationTitle(IosLocalizationKt.localizedString(resource: MR.strings.shared.currencies_section_title)) #if os(iOS) .navigationBarTitleDisplayMode(.inline) @@ -58,6 +54,15 @@ struct CurrencyPickerSheet: View { } } } + // Applied to the NavigationStack rather than chained onto the List below, alongside + // .toolbar/.navigationTitle: combining all three on the same view triggers a SwiftUI/ + // AppKit bug on macOS ("Update ToolbarReader tried to update multiple times per frame", + // logged every time this sheet's first presentation animates in) — harmless in practice, + // but splitting .searchable onto the outer view avoids it entirely. + .searchable( + text: $searchQuery, + prompt: IosLocalizationKt.localizedString(resource: MR.strings.shared.search_currencies_placeholder) + ) #if os(macOS) // macOS sizes a .sheet() to its content's ideal size rather than the parent window's // size (unlike iOS, which presents modally full-size); without an explicit frame here,