Skip to content

Commit 41698cc

Browse files
authored
Merge pull request #1222 from Esri/Caleb/Fix-PopupViewLists
`PopupView` - Fix list bugs
2 parents 61a5302 + d7bc24b commit 41698cc

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

Sources/ArcGISToolkit/Components/Popups/EmbeddedPopupView.swift

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ struct EmbeddedPopupView: View {
5454
)
5555
ProgressView()
5656
}
57-
.frame(maxWidth: .infinity)
5857
}
5958
}
59+
#if targetEnvironment(macCatalyst)
60+
.frame(maxWidth: .infinity, maxHeight: .infinity)
61+
.background(Color(.systemBackground))
62+
#endif
6063
.preference(key: PresentedPopupPreferenceKey.self, value: .init(popup: popup))
6164
.popupViewHeader(title: popup.title)
6265
.task(id: ObjectIdentifier(popup)) {
@@ -127,11 +130,9 @@ extension EmbeddedPopupView {
127130
EmptyView()
128131
}
129132
}
130-
#if targetEnvironment(macCatalyst)
131-
.listRowInsets(.toolkitDefault)
132-
#endif
133+
.popupListRowStyle()
133134
}
134-
.listStyle(.inset)
135+
.listStyle(.plain)
135136
}
136137
}
137138
}
@@ -147,3 +148,13 @@ private extension Logger {
147148
Logger(subsystem: "com.esri.ArcGISToolkit", category: "PopupView")
148149
}
149150
}
151+
152+
extension View {
153+
/// Adds the list row style for the PopupView.
154+
func popupListRowStyle() -> some View {
155+
self.listSectionSeparator(.hidden, edges: .top)
156+
#if targetEnvironment(macCatalyst)
157+
.listRowInsets(.init(top: 8, leading: 19, bottom: 8, trailing: 19))
158+
#endif
159+
}
160+
}

Sources/ArcGISToolkit/Components/Popups/UtilityAssociationsPopupElementView.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,9 @@ private struct UtilityAssociationsFilterResultLink: View {
9595
NavigationLink {
9696
List(filterResult.groupResults, id: \.id) { groupResult in
9797
UtilityAssociationGroupResultView(groupResult: groupResult)
98-
#if targetEnvironment(macCatalyst)
99-
.listRowInsets(.toolkitDefault)
100-
#endif
98+
.popupListRowStyle()
10199
}
102-
.listStyle(.inset)
100+
.listStyle(.plain)
103101
.navigationTitle(filterResult.filter.displayTitle, subtitle: popupTitle)
104102
.navigationBarTitleDisplayMode(.inline)
105103
.popupViewToolbar()
@@ -206,11 +204,9 @@ private struct SearchUtilityAssociationResultsView: View {
206204
} label: {
207205
UtilityAssociationResultLabel(result: result)
208206
}
209-
#if targetEnvironment(macCatalyst)
210-
.listRowInsets(.toolkitDefault)
211-
#endif
207+
.popupListRowStyle()
212208
}
213-
.listStyle(.inset)
209+
.listStyle(.plain)
214210
.searchable(
215211
text: $text,
216212
placement: .navigationBarDrawer(displayMode: .always),

0 commit comments

Comments
 (0)