Skip to content

Commit 3808a52

Browse files
author
Reed Es
committed
Fix for appearance in watchOS 10, #1
1 parent 43d814f commit 3808a52

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

Sources/TextFieldPreset.swift

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,19 @@ public struct TextFieldPreset<ButtonLabel, GroupKey, PresettedItem, PickerLabel>
6262
// MARK: - Views
6363

6464
public var body: some View {
65-
HStack {
66-
TextField(text: $text,
67-
prompt: Text(prompt),
68-
axis: axis) { EmptyView() }
69-
70-
Button(action: { isPresented = true },
71-
label: buttonLabel)
72-
.buttonStyle(.borderless)
73-
}
65+
TextField(text: $text,
66+
prompt: Text(prompt),
67+
axis: axis) { EmptyView() }
68+
.overlay {
69+
HStack {
70+
Spacer()
71+
buttonLabel()
72+
.contentShape(Rectangle())
73+
.onTapGesture {
74+
isPresented = true
75+
}
76+
}
77+
}
7478
.sheet(isPresented: $isPresented) {
7579
NavigationStack {
7680
PresetsPicker(presets: presets,

0 commit comments

Comments
 (0)