With this we have a lot of reflows! Actually this line makes this code to work properly when removing the secondline, because we are reseting the height in every letter typed!
I've been testing modifying the code and I would like to suggest the following:
```
    var isMoreThanOneLine = this.subjectInput.value && this.subjectInput.value.match(/\n/g);
    // Cache min height
    if (!this.SUBJECT_MIN_HEIGHT) {
      this.SUBJECT_MIN_HEIGHT = this.subjectInput.scrollHeight;
      this.SUBJECT_PREVIOUS_HEIGHT = this.subjectInput.scrollHeight;
    }
    // Calculate the expected height
    var expectedHeight;
    if (!isMoreThanOneLine) {
      expectedHeight = this.SUBJECT_MIN_HEIGHT;
    } else {
      expectedHeight = this.SUBJECT_MAX_HEIGHT;
    }
    // Do we need to update?
    if (expectedHeight !== this.SUBJECT_PREVIOUS_HEIGHT) {
      // We need to update
      this.subjectInput.style.height = expectedHeight + 'px';
      this.SUBJECT_PREVIOUS_HEIGHT = this.subjectInput.scrollHeight;
      this.updateInputMaxHeight();
      this.updateInputHeight();
    }
```

I've tested on the device and it's working as expected! And no reflows :)