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

When opening app in landscape, wrong number of columns displayed #18

Open
simibac opened this issue Nov 4, 2019 · 2 comments
Open

When opening app in landscape, wrong number of columns displayed #18

simibac opened this issue Nov 4, 2019 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@simibac
Copy link

simibac commented Nov 4, 2019

The wrong number of columns are displayed, when opening the app directly in landscape. The initial device orientation is not detected.

@karolkulesza
Copy link
Collaborator

karolkulesza commented Nov 10, 2019

Cannot reproduce. Are you able to provide more details?
Are you using the test app delivered within this repo? If not, please provide sample code.
Which device/simulator are you testing on? (with exact iOS version).

@karolkulesza karolkulesza added the question Further information is requested label Nov 10, 2019
@simibac
Copy link
Author

simibac commented Nov 11, 2019

The problem can be reproduced as follows:

  1. Use QGrid within a NavigationLink
struct DataPoint: Identifiable{
    var id = UUID()
    var name:String
}


struct ContentView: View {
    var data:Array<DataPoint> = [DataPoint(name: "A"), DataPoint(name: "B"), DataPoint(name: "C"), DataPoint(name: "D"), DataPoint(name: "E"), DataPoint(name: "F"), DataPoint(name: "G"), DataPoint(name: "H"), DataPoint(name: "J"), DataPoint(name: "K"), DataPoint(name: "L"), DataPoint(name: "M")]
    
    var body: some View {
        NavigationView{
            NavigationLink(destination:
                QGrid(data,
                  columns: 1,
                  columnsInLandscape: 4,
                  content: { data in
                    VStack{
                        Text(data.name)
                    }
                })
            ){
                Text("navigate to QGrid")
            }
        }
    }
}
  1. Start simulator and rotate it to landscape.

  2. Build and run application.

  3. Navigate to QGrid.

Screenshot 2019-11-11 at 12 46 29

Screenshot 2019-11-11 at 12 46 35

⚠️ This shows the wrong number of columns.

  1. Rotate device to portrait and back to landscape.

Screenshot 2019-11-11 at 12 48 10

✔️ This shows the correct amount of columns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants