Post

Replies

Boosts

Views

Activity

Comment on Disable a `contextMenu` button conditionally depending on the list item
Thanks for the answer! This doesn't immediately solves it but leads to more insights. Adding some print statement it seems that the onAppear and onChange is effectively acting on the Text(parent.name), not the contextMenu Button. .onChange does print differently upon children change, but then all list items is now sharing the same disableDelete. This approach won't work as it would require an array of disableDelete to track each Text(parent.name).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24