From ccba6965b67a431d381c0da897040dbf0a972960 Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Thu, 30 May 2013 18:16:27 -0700 Subject: [PATCH] Update examples to use onInput instead of onKeyUp onInput has the advantage that it responds to repeated key events before onKeyUp and is called when modifying the input without the keyboard (such as pasting with the mouse). Test Plan: Opened the ballmer-peak example and docs homepage in Chrome and checked that both examples update whenever the text is changed. --- _js/examples/markdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_js/examples/markdown.js b/_js/examples/markdown.js index ec4363f5..ec70b955 100644 --- a/_js/examples/markdown.js +++ b/_js/examples/markdown.js @@ -11,14 +11,14 @@ var MarkdownEditor = React.createClass({\n\ getInitialState: function() {\n\ return {value: 'Type some *markdown* here!'};\n\ },\n\ - handleKeyUp: React.autoBind(function() {\n\ + handleInput: React.autoBind(function() {\n\ this.setState({value: this.refs.textarea.getDOMNode().value});\n\ }),\n\ render: function() {\n\ return (\n\
\n\

Input

\n\ - \n\

Output

\n\