From 449c6ce3f239cb13b45777e4dde95e5d9ff18f99 Mon Sep 17 00:00:00 2001 From: Roman <51091564+jeanpierreroma@users.noreply.github.com> Date: Wed, 29 Jul 2026 18:50:07 +0300 Subject: [PATCH] fix: keep TextField prompts as Text instead of dashFont MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dashFont conversion turned two TextField prompts into some View. A prompt must be a Text, so both call sites failed to compile: SearchBar.swift:146 Cannot convert value of type 'some View' to Text AddressFieldView.swift:126 Reverts those two to .font(Font.dash.subhead), which is the correct call here regardless — dashFont pairs a font with a line height, and a line height cannot be applied to Text in the first place. Both files are wrapped in #if canImport(UIKit), so swift build on macOS never compiled them. Verified with xcodebuild against an iOS destination. --- Sources/DashUIKit/Components/AddressFieldView.swift | 4 +++- Sources/DashUIKit/Components/SearchBar.swift | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/DashUIKit/Components/AddressFieldView.swift b/Sources/DashUIKit/Components/AddressFieldView.swift index db53e1a..0278960 100644 --- a/Sources/DashUIKit/Components/AddressFieldView.swift +++ b/Sources/DashUIKit/Components/AddressFieldView.swift @@ -121,8 +121,10 @@ public struct AddressFieldView: View { TextField( "", text: $text, + // A prompt must stay a `Text`; `dashFont` returns `some View`, and a + // line height cannot be applied to `Text` anyway. prompt: Text(placeholder) - .dashFont(.subhead) + .font(Font.dash.subhead) .foregroundStyle(Color.dash.black1000Alpha30), axis: .vertical ) diff --git a/Sources/DashUIKit/Components/SearchBar.swift b/Sources/DashUIKit/Components/SearchBar.swift index 3f5471a..7614b08 100644 --- a/Sources/DashUIKit/Components/SearchBar.swift +++ b/Sources/DashUIKit/Components/SearchBar.swift @@ -141,8 +141,10 @@ private struct SearchBarFocused: View { if #available(iOS 17.0, *) { TextField( text: $text, + // A prompt must stay a `Text`; `dashFont` returns `some View`, and a + // line height cannot be applied to `Text` anyway. prompt: Text(placeholder) - .dashFont(.subhead) + .font(Font.dash.subhead) .foregroundStyle(Color.dash.black1000Alpha30) ) { EmptyView()