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

Keyboard reopens if there is a geometry reader #6

Open
AramAramAram opened this issue Jan 8, 2022 · 2 comments
Open

Keyboard reopens if there is a geometry reader #6

AramAramAram opened this issue Jan 8, 2022 · 2 comments

Comments

@AramAramAram
Copy link

Hi, first thanks for package.

There is an issue if Textfield is within Geometry reader, last one keeps keyboard reopening because of view redrawn.

GeometryReader { metrics in
VStack{
TextField("Username", text: $username)
.padding(9)
.background(focusedField == .username ? Color.red : Color(.systemGray6))
.cornerRadius(8)
.focusedLegacy($focusedField, equals: .username)

        TextField("Password", text: $password)
            .padding(9)
            .background(focusedField == .password ? Color.red : Color(.systemGray6))
            .cornerRadius(8)
            .focusedLegacy($focusedField, equals: .password)
        
        TextField("Name", text: $name)
            .padding(9)
            .background(focusedField == .name ? Color.red : Color(.systemGray6))
            .cornerRadius(8)
            .focusedLegacy($focusedField, equals: .name)

}
}

Thanks,
Aram

@rak-sascha-github
Copy link

This is a huge blocker! Any chance for a fast fix update?

@rak-sascha-github
Copy link

rak-sascha-github commented Mar 31, 2022

FWIW I ultimate removed all geometry readers from my app that are used in views in navigation view, not only because of this issue but also because on iOS 14 geometry reader causes lots of issues in navigation view when any sub view's frame height is set with it. Instead I'm relying on using window.screen.bounds.width and window.screen.bounds.height for measurements for now.

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

2 participants