Fixed error: @state.value does not work with multiline=true

old
Javi Jimenez Villar 2015-06-30 10:58:37 +07:00
parent 5b071de6bf
commit 9fc0199070
1 changed files with 5 additions and 1 deletions

View File

@ -52,7 +52,11 @@ module.exports = React.createClass
<div data-component-input={@props.type} className={className}>
{
if @props.multiline
<textarea ref="input" {...@props} onChange={@onChange}>{@state.value}</textarea>
<textarea ref="input" {...@props} value={@state.value}
onChange={@onChange}
onKeyPress={@props.onKeyPress}
onFocus={@props.onFocus}
onBlur={@props.onBlur}>{@state.value}</textarea>
else
<input ref="input" {...@props} value={@state.value} checked={@state.checked} 
onChange={@onChange}