Inconsistent Scrolling in PopupView
rrphenix opened this issue · 2 comments
Hi,
Quick question regarding some inconsistent scrolling I'm running into using the LNPopUp UI.
Goal: Add a horizontally paging view in the popup view
What I've Tried: I've made the following changes to the demo project to accomplish this:
//SafeAreaDemoView(colorSeed: "Popup", offset: true, isPopupOpen: isPopupOpen)
ScrollView {
TabView {
SafeAreaDemoView(colorSeed: "tab_0" )
SafeAreaDemoView(colorSeed: "tab_1" )
SafeAreaDemoView(colorSeed: "tab_2" )
SafeAreaDemoView(colorSeed: "tab_3" )
}
.frame(
width: UIScreen.main.bounds.width ,
height: UIScreen.main.bounds.height
)
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .always))
.indexViewStyle(PageIndexViewStyle(backgroundDisplayMode: .always))
}.edgesIgnoringSafeArea(.all)
.popupTitle(demoContent.title, subtitle: demoContent.subtitle)
.popupImage(Image("genre\(demoContent.imageNumber)"))
What I expect to happen:
- Be able to swipe up to reveal popup view
- Be able to swipe left/right within the popup view
What happens: Swiping horizonatally works occasionally, however about 30% of touches get lost. Also, the PopUpUI sporadically closes following some of the swipes. It seems like the gesture recognizer might be a bit too sensitive in the vertical direction. Horizontal swiping works most consistently when you swipe diagonally up+left or up+right
Thanks, I will take a look.
Looking at your code, it seems you are embedding a scroll view inside a scroll view, which is not a good idea. In general, it seems a tab view with PageTabViewStyle
behaves very oddly.
I will try to tweak the scroll view gesture handling to work better, but keep in mind that PageTabViewStyle
will be buggy regardless.