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

FB14685760: LabeledContent breaks when placed inside a List, if it contains a TextField. #541

Open
migueldeicaza opened this issue Aug 6, 2024 · 0 comments

Comments

@migueldeicaza
Copy link

migueldeicaza commented Aug 6, 2024

  • Date: 2024-08/06
  • Resolution: Open
  • Area: SwiftUI
  • OS: iOS 18 Seed 4
  • Type: Incorrect/Unexpected Behavior
  • Keywords: Regression

Description

The following example render a label and the textfield on iOS 17.5, but on iOS 18, the TextField takes over the entire line.

I have tried all the .listStyle options


import SwiftUI

struct ContentView: View {
    var body: some View {
        List {
            LabeledContent {
                TextField ("placeholder", text: .constant (""))
            } label: {
                Text ("Hello")
            }
        }
        .padding()
    }
}

#Preview {
    ContentView()
}

Included screenshots show that iOS 17.5 correctly displays the labels, while on iOS 18, only the textfield is rendered.

Files

iOS 17.5, works:
image

iOS 18.0, Beta 2 and Beta 4:
image

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