From 89b462cea6652498fee9e820fb6c2ea770eeaf70 Mon Sep 17 00:00:00 2001 From: sridhar02 Date: Wed, 7 Oct 2020 19:46:26 +0530 Subject: [PATCH 1/2] ref variable name change --- .../edit_channel_header_modal.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/edit_channel_header_modal/edit_channel_header_modal.jsx b/components/edit_channel_header_modal/edit_channel_header_modal.jsx index 47ba429df485..6b52dc464335 100644 --- a/components/edit_channel_header_modal/edit_channel_header_modal.jsx +++ b/components/edit_channel_header_modal/edit_channel_header_modal.jsx @@ -79,6 +79,7 @@ class EditChannelHeaderModal extends React.PureComponent { header: props.channel.header, saving: false, }; + this.editChannelHeaderTextboxRef = React.createRef(); } handleModalKeyDown = (e) => { @@ -120,14 +121,14 @@ class EditChannelHeaderModal extends React.PureComponent { } focusTextbox = () => { - if (this.refs.editChannelHeaderTextbox) { - this.refs.editChannelHeaderTextbox.focus(); + if (this.editChannelHeaderTextboxRef.current) { + this.editChannelHeaderTextboxRef.current.focus(); } } blurTextbox = () => { - if (this.refs.editChannelHeaderTextbox) { - this.refs.editChannelHeaderTextbox.blur(); + if (this.editChannelHeaderTextboxRef.current) { + this.editChannelHeaderTextboxRef.current.blur(); } } From d458373998eb699dd99972d587afe4e18af27c25 Mon Sep 17 00:00:00 2001 From: sridhar02 Date: Wed, 7 Oct 2020 19:55:25 +0530 Subject: [PATCH 2/2] change ref --- .../edit_channel_header_modal/edit_channel_header_modal.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/edit_channel_header_modal/edit_channel_header_modal.jsx b/components/edit_channel_header_modal/edit_channel_header_modal.jsx index 6b52dc464335..1956dbd173ba 100644 --- a/components/edit_channel_header_modal/edit_channel_header_modal.jsx +++ b/components/edit_channel_header_modal/edit_channel_header_modal.jsx @@ -243,7 +243,7 @@ class EditChannelHeaderModal extends React.PureComponent { handlePostError={this.handlePostError} channelId={this.props.channel.id} id='edit_textbox' - ref='editChannelHeaderTextbox' + ref={this.editChannelHeaderTextboxRef} characterLimit={1024} preview={this.props.shouldShowPreview} />