2016-08-26 00:10:22 +02:00
|
|
|
import Ember from 'ember';
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A work-a-round to support autofocus in Ember.js components.
|
|
|
|
* Background: https://github.com/emberjs/ember.js/issues/12589
|
|
|
|
*/
|
|
|
|
|
|
|
|
export default Ember.Mixin.create({
|
2018-10-28 22:54:14 +01:00
|
|
|
didInsertElement() {
|
|
|
|
this._super(...arguments);
|
|
|
|
|
2016-08-26 00:10:22 +02:00
|
|
|
if (this.get('autofocus')) {
|
|
|
|
this.$().focus();
|
|
|
|
}
|
2018-10-28 22:54:14 +01:00
|
|
|
}
|
2016-08-26 00:10:22 +02:00
|
|
|
});
|