I am using Ionic, and have a ion-textarea i would like to auto size, i.e. expand as the user adds more text. I have found ionic2-autosize, which is a directive. However, I cannot seem to make this directive have any effect on my ion-textarea, i.e. it does not expand as the user adds more text.
As you can see, I add the autosize attribute to the ion-textarea, but this has no effect, it behaves like a regular ion-textarea with only a height of 2 lines. I would expect the height to expand dynamically.
Any help appreciated.
More info:
global packages:
@ionic/cli-utils : 1.1.2
Cordova CLI : 6.4.0
Ionic CLI : 3.1.2
local packages:
@ionic/app-scripts : 1.3.0
@ionic/cli-plugin-cordova : 1.1.2
@ionic/cli-plugin-ionic-angular : 1.1.2
Ionic Framework : ionic-angular 3.2.1
System:
Node : v7.10.0
OS : macOS Sierra
Xcode : Xcode 8.3.2 Build version 8E2002
ios-deploy : not installed
ios-sim : not installed
Since I added fz-elastic, I am however experiencing some strange behaviour. This only happens on a device, and not in a browser.
I have a form with an ion-input and two ion-textarea’s. If I input a number of rows of data into a ion-textarea, and then scroll to the bottom of the page, where I have a submit button, it automatically scrolls back up to the ion-textarea, so that I cannot click the button.
I even remove focus from the ion-textarea by clicking on a ion-radio I have just above the button, but it still just scrolls after a few milliseconds back up to the ion-textarea.