bakerac4 / glimmer-native

77 stars 5 forks source link

TextField needed #10

Closed CodingItWrong closed 5 years ago

CodingItWrong commented 5 years ago

Am I correct in seeing that TextField has not yet been implemented? I don't see it in the list in the readme, and if I try to use <TextField /> I get the error:

*** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: Right side of assignment cannot be destructured
at
1   lookupComponent@file:///app/vendor.js:29891:20
CodingItWrong commented 5 years ago

I see that TextView is available, though, so that's cool to get started.

The text attribute on TextView doesn't seem to be two-way bound: it allows me to provide the initial text shown, but when I edit it, that doesn't make its way back to the bound and tracked attribute. Is there a different way I should be using to get access to the updated text?

CodingItWrong commented 5 years ago

For others' future reference, looks like an explicit event handler works:

    <TextView
      text={{this.newTodo}}
      {{on "textChange" (action handleChangeText)}}
    />
    handleChangeText(event) {
      this.newTodo = event.value
    }
bakerac4 commented 5 years ago

Closed by #12