Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageBox onChange > onInput #69

Merged
merged 2 commits into from
May 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build/scripts/rhinostyle-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -23830,8 +23830,8 @@ var MessageBox = function (_React$Component) {
}, _this._handleChange = function (event) {
_this.setState({ value: event.target.value });

if (_this.props.onChange && _typeof(_this.props.onChange === 'function')) {
_this.props.onChange(event.target.id, event.target.value);
if (_this.props.onInput && _typeof(_this.props.onInput === 'function')) {
_this.props.onInput(event.target.id, event.target.value);
}
}, _this._handleClick = function (event) {
if (_this.props.onClick && _typeof(_this.props.onClick === 'function')) {
Expand Down Expand Up @@ -23920,7 +23920,7 @@ var MessageBox = function (_React$Component) {
'div',
{ className: formGroupClasses },
showLabel(),
_react2.default.createElement(_reactTextareaAutosize2.default, { rows: rows, placeholder: placeholder, className: textAreaClasses, style: messageBoxStyle, value: this.state.value, onKeyPress: this._handleKeyPress, onChange: this._handleChange, onClick: this._handleClick, disabled: disabled, ref: function ref(_ref2) {
_react2.default.createElement(_reactTextareaAutosize2.default, { rows: rows, placeholder: placeholder, className: textAreaClasses, style: messageBoxStyle, value: this.state.value, onKeyPress: this._handleKeyPress, onInput: this._handleChange, onClick: this._handleClick, disabled: disabled, ref: function ref(_ref2) {
return _this2.rhinoTextArea = _ref2;
} })
);
Expand All @@ -23937,7 +23937,7 @@ MessageBox.propTypes = {
label: _react2.default.PropTypes.string,
name: _react2.default.PropTypes.string,
onClick: _react2.default.PropTypes.func,
onChange: _react2.default.PropTypes.func,
onInput: _react2.default.PropTypes.func,
onKeyPress: _react2.default.PropTypes.func,
placeholder: _react2.default.PropTypes.string,
required: _react2.default.PropTypes.bool,
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/rhinostyle-docs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/scripts/vendor.bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/scripts/rhinostyle.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/scripts/components/MessageBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MessageBox extends React.Component {
label: React.PropTypes.string,
name: React.PropTypes.string,
onClick: React.PropTypes.func,
onChange: React.PropTypes.func,
onInput: React.PropTypes.func,
onKeyPress: React.PropTypes.func,
placeholder: React.PropTypes.string,
required: React.PropTypes.bool,
Expand Down Expand Up @@ -59,8 +59,8 @@ class MessageBox extends React.Component {
_handleChange = (event) => {
this.setState({ value: event.target.value });

if (this.props.onChange && typeof (this.props.onChange === 'function')) {
this.props.onChange(event.target.id, event.target.value);
if (this.props.onInput && typeof (this.props.onInput === 'function')) {
this.props.onInput(event.target.id, event.target.value);
}
}

Expand Down Expand Up @@ -104,7 +104,7 @@ class MessageBox extends React.Component {
return (
<div className={formGroupClasses}>
{showLabel()}
<Textarea rows={rows} placeholder={placeholder} className={textAreaClasses} style={messageBoxStyle} value={this.state.value} onKeyPress={this._handleKeyPress} onChange={this._handleChange} onClick={this._handleClick} disabled={disabled} ref={ref => (this.rhinoTextArea = ref)} />
<Textarea rows={rows} placeholder={placeholder} className={textAreaClasses} style={messageBoxStyle} value={this.state.value} onKeyPress={this._handleKeyPress} onInput={this._handleChange} onClick={this._handleClick} disabled={disabled} ref={ref => (this.rhinoTextArea = ref)} />
</div>
);
}
Expand Down