Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FB15812999: SeparatorShapeStyle incorrectly inherits foregroundStyle in iPad apps running on Mac #585

Open
samhenrigold opened this issue Nov 14, 2024 · 0 comments

Comments

@samhenrigold
Copy link

  • Date: 2024-11-14
  • Resolution: Open
  • Area: SwiftUI
  • OS: macOS 15.1 Seed 6 (24B5070a)
  • Type: Incorrect/Unexpected Behavior
  • Keywords: SwiftUI ShapeStyle, “Designed for iPad” compatibility mode Mac apps

Description

When using SwiftUI's SeparatorShapeStyle in an iPad app running on Mac through iPad compatibility mode, the separator style incorrectly inherits the view's foregroundStyle color instead of maintaining its standard translucent gray appearance.

Steps to Reproduce:

  1. Create a shape and fill it with .fill(.separator)
  2. Set a foregroundStyle on a parent container view
  3. Run the app on iPad/iPhone - appears correct
  4. Run the same iPad app on Mac - separator incorrectly takes on the foreground color

Expected Behavior:
The SeparatorShapeStyle should maintain its standard translucent gray appearance regardless of the parent view's foregroundStyle, consistent with its behavior on iPadOS.

Note: This does not happen with other fill styles, such as .fill(.fill). Both systems will correctly render it as gray.

Files

Screenshot 2024-11-14 at 4 07 00 PM

Simulator Screenshot - iPad Air 11-inch (M2) - 2024-11-14 at 16 07 59

//
//  ContentView.swift
//  CanvasStyleTest
//
//  Created by Sam Gold on 2024-11-14.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        HStack(spacing: 64) {
            Circle()
                .fill(.separator)
                .frame(width: 128, height: 128)
            
            Circle()
                .frame(width: 128, height: 128)
        }
        .foregroundStyle(.blue)
    }
}


#Preview {
    ContentView()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant