This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Simple example that results in a phantom row when using OutlineGroup. | |
| // | |
| // Just click on the button three times. Make sure the List is fully expanded. | |
| // The issue seems to be that the List's selection is set to an item's ID that is not yet in the model. | |
| // | |
| import SwiftUI | |
| struct ContentView: View { | |
| @State var count = 0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // macOS + SwiftUI: Bug with DisclosureGroup and Selection | |
| // | |
| // This example shows a simple window with a sidebar list showing an outline. | |
| // Just follow the instructions in the sample app. Clicking the button three times will result in a phantom row. | |
| // | |
| // Reason seems that | |
| // 1. selection is set before the model update | |
| // 2. DisclosureGroup is inside a conditional view | |
| // | |
| // The problem disappears if DisclosureGroup is unconditional. Or when using OutlineGroup. |