From 0741d3be0a927ea659591ef811795018fbac85d0 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 25 Oct 2016 10:11:34 -0400 Subject: PLT-4404 Replace calls to onInput with onChange to better support IE11 (#4315) * Replace calls to onInput with onChange to better support IE11 * Replaced react-textarea-autosize with react-autosize-textarea --- webapp/components/channel_switch_modal.jsx | 6 +++--- webapp/components/create_comment.jsx | 6 +++--- webapp/components/create_post.jsx | 6 +++--- webapp/components/edit_post_modal.jsx | 6 +++--- webapp/components/search_bar.jsx | 6 +++--- webapp/components/suggestion/suggestion_box.jsx | 24 ++++++++++++------------ webapp/components/textbox.jsx | 4 ++-- webapp/package.json | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) (limited to 'webapp') diff --git a/webapp/components/channel_switch_modal.jsx b/webapp/components/channel_switch_modal.jsx index 17193d196..063962a18 100644 --- a/webapp/components/channel_switch_modal.jsx +++ b/webapp/components/channel_switch_modal.jsx @@ -23,7 +23,7 @@ export default class SwitchChannelModal extends React.Component { constructor() { super(); - this.onInput = this.onInput.bind(this); + this.onChange = this.onChange.bind(this); this.onShow = this.onShow.bind(this); this.onHide = this.onHide.bind(this); this.onExited = this.onExited.bind(this); @@ -68,7 +68,7 @@ export default class SwitchChannelModal extends React.Component { }); } - onInput(e) { + onChange(e) { this.setState({text: e.target.value}); } @@ -152,7 +152,7 @@ export default class SwitchChannelModal extends React.Component { ref='search' className='form-control focused' type='input' - onInput={this.onInput} + onChange={this.onChange} value={this.state.text} onKeyDown={this.handleKeyDown} listComponent={SuggestionList} diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx index 1783f4d90..4b5134d23 100644 --- a/webapp/components/create_comment.jsx +++ b/webapp/components/create_comment.jsx @@ -35,7 +35,7 @@ export default class CreateComment extends React.Component { this.handleSubmit = this.handleSubmit.bind(this); this.commentMsgKeyPress = this.commentMsgKeyPress.bind(this); - this.handleInput = this.handleInput.bind(this); + this.handleChange = this.handleChange.bind(this); this.handleKeyDown = this.handleKeyDown.bind(this); this.handleUploadClick = this.handleUploadClick.bind(this); this.handleUploadStart = this.handleUploadStart.bind(this); @@ -180,7 +180,7 @@ export default class CreateComment extends React.Component { GlobalActions.emitLocalUserTypingEvent(this.props.channelId, this.props.rootId); } - handleInput(e) { + handleChange(e) { const messageText = e.target.value; const draft = PostStore.getCommentDraft(this.props.rootId); @@ -393,7 +393,7 @@ export default class CreateComment extends React.Component { >
); @@ -167,7 +167,7 @@ export default class SuggestionBox extends React.Component { ref='textbox' type='search' {...this.props} - onInput={this.handleInput} + onChange={this.handleChange} onKeyDown={this.handleKeyDown} /> ); @@ -177,7 +177,7 @@ export default class SuggestionBox extends React.Component { id={this.suggestionId} ref='textbox' {...this.props} - onInput={this.handleInput} + onChange={this.handleChange} onKeyDown={this.handleKeyDown} /> ); @@ -226,6 +226,6 @@ SuggestionBox.propTypes = { renderDividers: React.PropTypes.bool, // explicitly name any input event handlers we override and need to manually call - onInput: React.PropTypes.func, + onChange: React.PropTypes.func, onKeyDown: React.PropTypes.func }; diff --git a/webapp/components/textbox.jsx b/webapp/components/textbox.jsx index 44468a67a..bf87d4d45 100644 --- a/webapp/components/textbox.jsx +++ b/webapp/components/textbox.jsx @@ -206,7 +206,7 @@ export default class Textbox extends React.Component { spellCheck='true' maxLength={Constants.MAX_POST_LEN} placeholder={this.props.createMessage} - onInput={this.props.onInput} + onChange={this.props.onChange} onKeyPress={this.handleKeyPress} onKeyDown={this.handleKeyDown} onHeightChange={this.handleHeightChange} @@ -251,7 +251,7 @@ Textbox.propTypes = { id: React.PropTypes.string.isRequired, channelId: React.PropTypes.string, messageText: React.PropTypes.string.isRequired, - onInput: React.PropTypes.func.isRequired, + onChange: React.PropTypes.func.isRequired, onKeyPress: React.PropTypes.func.isRequired, createMessage: React.PropTypes.string.isRequired, onKeyDown: React.PropTypes.func, diff --git a/webapp/package.json b/webapp/package.json index 3a38661d1..6e4a7c17a 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -24,13 +24,13 @@ "perfect-scrollbar": "0.6.12", "react": "15.3.2", "react-addons-pure-render-mixin": "15.3.2", + "react-autosize-textarea": "0.3.3", "react-bootstrap": "0.30.3", "react-custom-scrollbars": "4.0.0", "react-dom": "15.3.2", "react-intl": "2.1.5", "react-router": "2.8.1", "react-select": "1.0.0-rc.2", - "react-textarea-autosize": "4.0.5", "superagent": "2.3.0", "twemoji": "2.2.0", "velocity-animate": "1.2.3", -- cgit v1.2.3-1-g7c22