Last active
July 11, 2017 08:52
-
-
Save Romanior/6145b430b3a1f0db9a841d1f031229f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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