My example is taken almost directly from the react documentation: http://facebook.github.io/react/docs/forms.html#controlled-components
Thanks for the idea on intercepting onKeyDown- That is good workaround, less awkward than my approach of an explicit om/referesh! call. On Thursday, February 12, 2015 at 3:33:59 PM UTC-6, Roger Gilliar wrote: > The problem is that just truncating the value doesn't stop the event > propagation. > > You might add as a very simple hack: > > :onKeyDown (fn[e] > (let [value (.-keyCode e)] > (when (and (> value 40) (>= (count (:text @app-state)) 10)) > (.preventDefault e)))) > > Nevertheless I'lll have to check if plain React.js behaves the same way. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
