-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when using justification #22
Comments
Thanks for the crash report! Do you have sample code to reproduce the issue? I tried the following but didn't crash: import Flow
import SwiftUI
import SwiftUIRadioButtons
@main
struct ExampleApp: App {
var body: some Scene {
WindowGroup {
Bug()
}
}
}
struct Bug: View {
@State private var selected: String? = nil
var body: some View {
HFlow(justification: .stretchItemsAndSpaces) {
HRadioCollection(
selectedData: $selected,
data: ["a", "b", "c"]
) { value in
Text(value)
}
}
}
}
extension String: @retroactive Identifiable {
public var id: String { self }
} |
I really tried to reproduce this crash using sample code and extending it but I can't. It happens after doing drag & drop and even though I added this functionality to the sample app it still works properly. I checked and both apps are using the latest v2.5.0 release. Unfortunately the crash is still happening in the app. But maybe this can help you: The crash cause happens here:
Maybe this output can help you identify where the problem occurs?
Then when the execution reaches:
And the crash finally happens here:
I thin that the root cause is in the fact that
bounds had width: 0
I hope this helps! |
Thank you for the debug info! I'll take a look. |
When I want to wrap RadioCollection in HFlow and use justification I am getting following crash:
SwiftUICore/Layout.swift:1534: Fatal error: view origin is invalid: (nan, 0.0), UnitPoint(x: 0.0, y: 0.0), (inf, 20.5)
Am I doing something wrong or is this a bug in the library?
Btw. awesome work, keep going on!
The text was updated successfully, but these errors were encountered: