You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I started attempting to integrate SwiftDown into a cross-platform SwiftUI project that utilizes a NavigationSplitView, and noticed an odd behavior where SwiftDown seems to always be referencing an older item. I've tried many different variations of utilizing NavigationSplitView, but all of them exhibit this issue. If I use the deprecated NavigationView instead, this problem does not occur.
You'll note that only the SwiftDown field suffers from this issue—editing via the TextEditor in the same VStack appropriately updates the correct, currently-selected item.
Expected behavior
SwiftDown field would edit the correct item's text, like TextEditor does.
Screenshots
Attaching a video of this bug in action as well, using the sample code linked above.
SwiftDownSplitViewExample.mov
Desktop (please complete the following information):
OS: macOS
Version 14.3.1
The text was updated successfully, but these errors were encountered:
👋 Hey, thanks for your feedback! It seems like adding an .id on the SwiftDownEditor that depends on your Item would fix that. I don't have an idea on how I could fix that from the package for now to be honest
👋 Hey, thanks for your feedback! It seems like adding an .id on the SwiftDownEditor that depends on your Item would fix that. I don't have an idea on how I could fix that from the package for now to be honest
It's hilarious how simple this solution is, and, of course, completely resolves the issue. I was so deep in NavigationSplitView insanity in this project that I completely missed it. Thank you!
Describe the bug
I started attempting to integrate SwiftDown into a cross-platform SwiftUI project that utilizes a NavigationSplitView, and noticed an odd behavior where SwiftDown seems to always be referencing an older item. I've tried many different variations of utilizing NavigationSplitView, but all of them exhibit this issue. If I use the deprecated NavigationView instead, this problem does not occur.
To Reproduce
Here's some sample code to show off the issue: https://gist.github.com/garrettmurray/4e23b2478f89beae47913a78d9c194a2
You'll note that only the SwiftDown field suffers from this issue—editing via the TextEditor in the same VStack appropriately updates the correct, currently-selected item.
Expected behavior
SwiftDown field would edit the correct item's text, like TextEditor does.
Screenshots
Attaching a video of this bug in action as well, using the sample code linked above.
SwiftDownSplitViewExample.mov
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: