Skip to content

Instantly share code, notes, and snippets.

@Romanior
Last active July 11, 2017 08:52
Show Gist options
  • Save Romanior/6145b430b3a1f0db9a841d1f031229f0 to your computer and use it in GitHub Desktop.
Save Romanior/6145b430b3a1f0db9a841d1f031229f0 to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement() {
this._super(...arguments);
if (this.attrs.isAutoresize) {
this.resize();
}
},
resize: function() {
if (this.attrs.isAutoresize) {
const $el = this.$();
$el.css('height', '1');
$el.css('height', $el[0].scrollHeight);
}
}.on('input')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment