From 3808a52e81c430cd5b54cfb95bef265b2bc3465e Mon Sep 17 00:00:00 2001 From: Reed Es Date: Wed, 11 Oct 2023 22:55:15 -0600 Subject: [PATCH] Fix for appearance in watchOS 10, #1 --- Sources/TextFieldPreset.swift | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Sources/TextFieldPreset.swift b/Sources/TextFieldPreset.swift index 165d3f7..a62a18c 100644 --- a/Sources/TextFieldPreset.swift +++ b/Sources/TextFieldPreset.swift @@ -62,15 +62,19 @@ public struct TextFieldPreset // MARK: - Views public var body: some View { - HStack { - TextField(text: $text, - prompt: Text(prompt), - axis: axis) { EmptyView() } - - Button(action: { isPresented = true }, - label: buttonLabel) - .buttonStyle(.borderless) - } + TextField(text: $text, + prompt: Text(prompt), + axis: axis) { EmptyView() } + .overlay { + HStack { + Spacer() + buttonLabel() + .contentShape(Rectangle()) + .onTapGesture { + isPresented = true + } + } + } .sheet(isPresented: $isPresented) { NavigationStack { PresetsPicker(presets: presets,