Comments (20)
Hmm, wow, never seen that. Need to check if this is a SwiftUI layout bug, or my underlying framework is buggy. Will look soon.
from lnpopupui.
BTW, this isnβt supposed to happen. The popup bar is supposed to remain glued to the tab bar. What OS is this?
from lnpopupui.
It's iOS 14.7.1. I'll see if it's something I'm doing in the app to make it unglued.
Here's another video that's a worse case where it gets stuck completely.
keyboard2.mp4
from lnpopupui.
Ok it seems .popupBarCustomView
is what causes the bar to be unglued from the tab bar, if I don't use it, it stays glued. However, the worse bug still happens. I'll see if I can make a small test project where it can be reproduced.
from lnpopupui.
Yes, please. That would be helpful.
from lnpopupui.
Hi, test project here can repo it easily: https://github.com/svenoaks/testPopupUI
Easier to use two hands.
For demo1.mp4 I click on the TextField then rapidly swipe down the sheet to dismiss with other hand.
For demo2.mp4 I click on the TextField then jam the CLOSE button with other hand.
It's only happening when the keyboard is in some kind of transitory state.
If I get rid of .popupBarCustomView
, I can't seem to make demo1 happen, but demo2 still does.
demo1.mp4
demo2.mp4
from lnpopupui.
This seems like a bug in SwiftUI. It is hellbent on providing the incorrect layout size for the custom popup bar view. There is no issue that I could see with a standard bar (because it is all UIKit). I've implemented a nasty hack that basically ignores popup bar size changes when the keyboard is open, and when it gets closed, it updates the size in case an actual size update is necessary. I think this is a relatively safe hack, as the custom popup bar view would normally change size only after user interaction.
from lnpopupui.
Please try 1.2.17. Thanks
from lnpopupui.
The one from demo1.mp4 is fixed in 1.2.17 but demo2 still happens. You have to use the Close button. It can happen with or without the custom popup bar. I updated the demo project without the custom bar, and here's a video of it happening without the custom popup bar.
demo3.mp4
from lnpopupui.
Interesting. Will look into it again.
from lnpopupui.
Interesting, it doesn't reproduce on iOS 15. That's good. I will see what hacks are necessary on iOS 14 to resolve this.
from lnpopupui.
Sorry, unable to reproduce.
Simulator.Screen.Recording.-.iPhone.8.Plus.-.2021-09-10.at.02.03.00.mp4
Simulator.Screen.Recording.-.iPhone.8.Plus.-.2021-09-10.at.02.01.24.mp4
from lnpopupui.
I tap on the TextFIeld with one hand, then immediately tap Close with the other hand, there's gotta be very little delay.
from lnpopupui.
Not reproducing:
RPReplay_Final1631229363.MP4
Please find a consistent way to reproduce this issue.
from lnpopupui.
try latest commit, it automates causing it two seconds after tapping on DOCUMENT PICKER button. I tried it on the iPhone 12 Pro Max Simulator iOS 14.5 (make sure the soft keyboard is coming out in Messages first, it's I/O...Keyboard...Toggle Soft Keyboard, but I think you have to click this when a TextField is focused), and iPhone 6s with iOS 14.7.1.
Not happening on iPad Pro, but SwiftUI uses a different component for .sheet there, so that might have something to do with it.
Not just an academic problem, I caused this a few times accidentally before I figured out where it was coming from.
from lnpopupui.
Your commit reproduced the issue, thanks. Investigating.
from lnpopupui.
You know, I'm not even sure this is a bug with the popup. It seems like resigning the first responder too quickly breaks the internal layout handling for safe areas. Even without any popup, notice how your tab view looks:
On iOS 15, this is fixed:
Likewise, your issue doesn't occur there:
Simulator.Screen.Recording.-.iPhone.12.Pro.Max.-.2021-09-10.at.03.34.34.mp4
I'm not sure what more I can do here. It seems SwiftUI layout is broken on iOS 14.
from lnpopupui.
Good find, it's a SwiftUI bug and glad to see fixed in iOS15.
from lnpopupui.
So, if I do this hack, it fixes the issues. π The problem comes from bad state management inside SwiftUI, where if the keyboard will hide notification is sent too early (~5 runloop spins), SwiftUI layout breaks.
Unfortunately, I don't feel comfortable adding this hack into LNPopupUI. If you'd like to add it, you can just register some object to listen to UIApplication.keyboardWillHideNotification
and repost the notification again, after 5 runloop spins. You can maybe only run it if iOS 14 and below.
from lnpopupui.
Thanks for that
from lnpopupui.
Related Issues (20)
- Change color of now playing bar background HOT 5
- iOS 15.2 has broken safe area insets under some conditions HOT 1
- LNPopupController: The popup controller is already in transition. Will ignore this transition request. HOT 2
- Using a custom view for the popup bar breaks presentation/dismiss animations HOT 4
- Run the example project HOT 1
- How to cooperate with withAnimation(...) when switching PopupOpen HOT 1
- After adding .popupBarStyle(.prominent) or .popupBarProgressViewStyle(.top) or .popupBarMarqueeScrollEnabled(true) to the View hierarchy, iOS keyboard will resign after single keypress HOT 3
- Possible regression between 1.4.0 and 1.4.1 in popupBarItems HOT 4
- Can't build test target while using LNPopupUI HOT 5
- Gesture Conflict HOT 3
- Interaction Style issues HOT 5
- State management breaks on quick opening/closing of the popup HOT 10
- Popover's background Scale Effect HOT 1
- Making isBarPresented = true, while its animating closed when set to false causes the popup to become bugged until open/closed again HOT 12
- Make popup image nullable
- Updating popup content while popup is closing causes popup to get stuck in a loop of closing and opening endlessly. HOT 6
- popupBarCustomView produces too much padding HOT 2
- Inconsistent Scrolling in PopupView HOT 2
- Limiting dragging area HOT 23
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lnpopupui.