Dimillian / IceCubesApp

A SwiftUI Mastodon client
https://apps.apple.com/us/app/ice-cubes-for-mastodon/id6444915884
GNU Affero General Public License v3.0
5.3k stars 490 forks source link

Fix #1885 blank options on profile page on macos #1906

Closed gMustafa42 closed 7 months ago

gMustafa42 commented 7 months ago

Environment:

Issue:

This pull request addresses problem #1885. In the AccountDetailView, when a user taps on the profile options button, a menu is displayed. However, on the macCatalyst app, blank rows are observed for certain options.

Causes:

The issue of blank rows arises when attempting to utilize a Divider within the Menu list, specifically when it is nested inside a Section. The root cause may be related to the implementation of SwiftUI views.

Menu {
    Section {
        Button("Option 1") { }
        Divider()
        Button("Option 2") { }
    }
}

Solution:

To resolve this issue, I introduced a conditional compilation block that ensures the compilation of the Divider function only occurs when the current operating system is not macOS.

Before After
1 2