Post

Replies

Boosts

Views

Activity

Reply to @State variable not updating after fullscreencover shows for the first time
In the button, remove the part where you're directly setting the contextMenu boolean. Button { selectedMessage = message } label: { MessageItem(message: message) } .buttonStyle(.plain) Then, add an onChange trigger in the same rank as your fullScreenCover. .onChange(of: selectedMessage) { newValue in contextMenu = newValue != nil } That way, it will always trigger after, rather than relying on the lines being synchronous.
Mar ’24