exyte / PopupView

Toasts and popups library written with SwiftUI
MIT License
3.41k stars 264 forks source link

Publishing changes from within view updates is not allowed, this will cause undefined behavior. #189

Open fanwgwg opened 5 months ago

fanwgwg commented 5 months ago

Seeing this warning when keyboard shows up with the PopupView, e.g., when the popup contains a TextField.

Publishing changes from within view updates is not allowed, this will cause undefined behavior.

screenshot-20240508-193100

f3dm76 commented 3 months ago

Hey @fanwgwg, I placed a TextField inside a popup, and I don't see any issues. Please attach a minimal compilable example and make sure the issue reproduces on this minimal example. Have a nice day

iosdevparty commented 2 months ago

Hello! I placed a TextField inside a popup and had got problem with "Publishing changes from within view updates is not allowed, this will cause undefined behavior." I have TextField inside GroupsMakingView.

Screenshot 2024-07-15 at 15 02 21

My code:

Screenshot 2024-07-15 at 15 05 29

@f3dm76

t9mike commented 2 months ago

Suggest you attach ZIP of a small Xcode project @iosdevparty that reproduce the issue. That is what the maintainer has requested.

f3dm76 commented 2 months ago

Hey @iosdevparty, I need the code to reproduce - not a picture of code. Please attach a full minimal example, it can be just a text message with code, but a zip is even better. Also please specify xcode, ios and lib versions

iosdevparty commented 2 months ago

Hey @iosdevparty, I need the code to reproduce - not a picture of code. Please attach a full minimal example, it can be just a text message with code, but a zip is even better. Also please specify xcode, ios and lib versions

Hello @f3dm76 @t9mike . My xcode Version 15.2 (15C500b). lib version 3.0.4. iOS 17.2 iphone15Pro. And I created simple project from main project. PopupViewBugReport.zip

muratozturk5 commented 1 day ago

I have faced same issue, my popup is doesn't contain any TextField. I tried to add DispatchQueue.main.async for two this code self.keyboardHeight = 0 self.keyboardDisplayed = false

and it looks like it solved the issue.

Lib Version : 3.0.0 XCode : Version 16.0 (16A242d) Iphone 16 Pro : IOS 18.0

image