From 1af4d202ef2e073333fa7829dd34a31d4cfc3f25 Mon Sep 17 00:00:00 2001 From: sienori Date: Sun, 24 Feb 2019 05:26:51 +0900 Subject: [PATCH] Fixed that input area is not resized when opening popup --- src/popup/components/InputArea.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/popup/components/InputArea.js b/src/popup/components/InputArea.js index 426d654..b97ab06 100644 --- a/src/popup/components/InputArea.js +++ b/src/popup/components/InputArea.js @@ -13,6 +13,14 @@ export default class InputArea extends Component { handleInputText = e => { const inputText = e.target.value; this.props.handleInputText(inputText); + }; + + shouldComponentUpdate(nextProps) { + const shouldUpdate = this.props.inputText !== nextProps.inputText; + return shouldUpdate; + } + + componentDidUpdate = () => { this.resizeTextArea(); };