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

Binding does not work on iOS 15.2 #6

Closed
darrarski opened this issue Dec 28, 2021 · 0 comments · Fixed by #7
Closed

Binding does not work on iOS 15.2 #6

darrarski opened this issue Dec 28, 2021 · 0 comments · Fixed by #7

Comments

@darrarski
Copy link
Contributor

Description

When a user enters text into CodeEditor, the binding is not called. This happens only on iOS. When using CodeEditor in a macOS app, there are no issues.

Environment

  • Xcode v13.2.1
  • iOS 15.2 Simulator

Steps to reproduce

  1. Embed CodeEditor in SwiftUI iOS application

    struct ContentView: View {
      @State var text = "TEST"
    
      var body: some View {
        VStack {
          CodeEditor(source: $text)
            .frame(height: 100)
    
          Divider()
    
          Text(text)
            .frame(maxWidth: .infinity, alignment: .leading)
            .multilineTextAlignment(.leading)
    
          Spacer()
        }
      }
    }
  2. Run the app in iOS Simulator

  3. Enter some text into CodeEditor

  4. Notice that the text property is not updated.

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

Successfully merging a pull request may close this issue.

1 participant