fix: improve seek gesture priority in mini player
Change seek gesture from .gesture to .highPriorityGesture to ensure horizontal press-and-drag seeking takes precedence over the vertical swipe gesture. This fixes unreliable seeking when dragging on the mini player progress bar.
This commit is contained in:
@@ -29,7 +29,7 @@ struct MiniPlayerView: View {
|
|||||||
.frame(width: max(0, geo.size.width * (isSeeking ? seekProgress : progress)))
|
.frame(width: max(0, geo.size.width * (isSeeking ? seekProgress : progress)))
|
||||||
}
|
}
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
.gesture(
|
.highPriorityGesture(
|
||||||
DragGesture(minimumDistance: 0)
|
DragGesture(minimumDistance: 0)
|
||||||
.onChanged { value in
|
.onChanged { value in
|
||||||
isSeeking = true
|
isSeeking = true
|
||||||
@@ -165,6 +165,8 @@ struct MiniPlayerView: View {
|
|||||||
}
|
}
|
||||||
.padding(.horizontal, 20)
|
.padding(.horizontal, 20)
|
||||||
.padding(.vertical, 12)
|
.padding(.vertical, 12)
|
||||||
|
// Block interaction with content layer from affecting progress bar
|
||||||
|
.allowsHitTesting(true)
|
||||||
}
|
}
|
||||||
.background(
|
.background(
|
||||||
// Dark rounded background (pill-shaped with full circular ends)
|
// Dark rounded background (pill-shaped with full circular ends)
|
||||||
|
|||||||
Reference in New Issue
Block a user