Skip to content

Commit

Permalink
🚑️ Implement SwiftUIIntrospect to correctly handle LuminareList s…
Browse files Browse the repository at this point in the history
…election highlight style
  • Loading branch information
KrLite committed Dec 16, 2024
1 parent a354837 commit 0288184
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
11 changes: 10 additions & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "561b512b42be15f5de7739225ed1dd81d798ebdca0a4622529c61e9f81303c85",
"originHash" : "ff1eab428ce698b2ba4197094f0d0f7530bfb7aea8c9f2c9e812a1bdcea27c19",
"pins" : [
{
"identity" : "swift-docc-plugin",
Expand All @@ -19,6 +19,15 @@
"version" : "1.0.0"
}
},
{
"identity" : "swiftui-introspect",
"kind" : "remoteSourceControl",
"location" : "https://github.com/siteline/swiftui-introspect",
"state" : {
"revision" : "807f73ce09a9b9723f12385e592b4e0aaebd3336",
"version" : "1.3.0"
}
},
{
"identity" : "swiftui-variadic-views",
"kind" : "remoteSourceControl",
Expand Down
6 changes: 4 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/lorenzofiamingo/swiftui-variadic-views", from: "1.0.0")
.package(url: "https://github.com/lorenzofiamingo/swiftui-variadic-views", from: "1.0.0"),
.package(url: "https://github.com/siteline/swiftui-introspect", from: "1.0.0"),

Check warning on line 19 in Package.swift

View workflow job for this annotation

GitHub Actions / Lint

Add or remove trailing comma from the last item in a collection literal. (trailingCommas)
],
targets: [
.target(
name: "Luminare",
dependencies: [
.product(name: "VariadicViews", package: "swiftui-variadic-views")
.product(name: "VariadicViews", package: "swiftui-variadic-views"),
.product(name: "SwiftUIIntrospect", package: "swiftui-introspect"),

Check warning on line 26 in Package.swift

View workflow job for this annotation

GitHub Actions / Lint

Add or remove trailing comma from the last item in a collection literal. (trailingCommas)
]
),
.testTarget(
Expand Down
4 changes: 4 additions & 0 deletions Sources/Luminare/Components/LuminareList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import SwiftUIIntrospect

public enum LuminareListRoundedCornerBehavior: String, Hashable, Equatable,
Identifiable, CaseIterable, Codable {
Expand Down Expand Up @@ -193,6 +194,9 @@ public struct LuminareList<ContentA, ContentB, V, ID>: View
.listStyle(.plain)
.scrollContentBackground(.hidden)
.scrollDisabled(hasFixedHeight)
.introspect(.list, on: .macOS(.v13, .v14, .v15)) { tableView in
tableView.selectionHighlightStyle = .none
}
}
}
.frame(height: hasFixedHeight ? totalHeight : nil)
Expand Down

This file was deleted.

0 comments on commit 0288184

Please sign in to comment.