Skip to content

Instantly share code, notes, and snippets.

@hedefalk
Created February 25, 2011 09:34
Show Gist options
  • Save hedefalk/843584 to your computer and use it in GitHub Desktop.
Save hedefalk/843584 to your computer and use it in GitHub Desktop.
implicit def bindableText(text: Text): Target[String] = {
new Target[String] {
def bind(value: Signal[String]) = observe(value) { newValue =>
if (!text.isFocusControl) // don't update the text that's editing
text.setText(newValue)
true // keep observing
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment