Questions tagged [disclosuregroup]

8 questions
1
vote
1 answer

How to I show a NavigationLink in a DisclosedGroup (SwiftUI)?

I'm trying to show a few items such as NavigationView in a DisclosureGroup and the group when opened shows nothing. Can someone help me (I'm just starting with SwiftUI)? An example of what I want to do: import SwiftUI @main struct ContentView: App…
1
vote
1 answer

Custom DisclosureGroup

I need to have a custom DisclosureGroup. I have a version of it working like this: public struct CustomDisclosureGroup: View { var label: LabelContent var content: Content @Binding var isExpanded: Bool …
Phantom59
  • 947
  • 1
  • 8
  • 19
0
votes
0 answers

SwiftUI - How to properly support selections within an outline view using DisclosureGroup?

I'm using DisclosureGroups to display a hierarchy in outline form, and added code to make the lines selectable. This works, except that the root entry cannot be selected. The root and branch lines can be expanded as expected, and all lines other…
0
votes
0 answers

How to create multiple nested lists in a sidebar that scrolls as one?

I am trying to create a sidebar that contains multiple DisclosureGroups where some of them contain a nested list. The whole sidebar when fully expanded will be longer than the screen, so it needs to scroll. My test code for macOS looks like…
The Lone Coder
  • 3,062
  • 4
  • 20
  • 35
0
votes
1 answer

how to start multiple disclosure groups already expanded swiftui

I have a foreach with a list of strings, Every element will have an expandable view. I want for all of them to start already expanded. And I also want to collapse/expand them individually. @State myLists = ["list1", "list2",…
dhaval123
  • 107
  • 11
0
votes
1 answer

NSManaged Property causing DisclosureGroup animation problems in Swiftui

I have an NSManagedObject with NSManaged properties that control the expanded/collapsed state of disclosure groups. Here's an example: /// Views that provides UI for app settings. struct SettingsView: View { @Binding var isExpanded: Bool var…
Phantom59
  • 947
  • 1
  • 8
  • 19
0
votes
1 answer

Recursive Disclosure Groups in SwiftUI

I would like to show a directory structure with all nodes expanded in SwiftUI. I found an example of a recursive disclosure view structure on the internet. The view: struct TracksDirOutlineView: View where Node: Hashable, Node: Identifiable,…
Money
  • 107
  • 5
0
votes
0 answers

on macOS a DisclosureGroup inside List crashes with .searchable

On macOS I get an unexpected crash with the following code when entering a search that is not in the data (e.g. "100"). It does NOT crash on iOS with the same code. Any hints appreciated. struct ContentView: View { let data: [Int] =…
ChrisR
  • 9,523
  • 1
  • 8
  • 26