Focus username by default

https://github.com/rancher/rancher/issues/10845
This commit is contained in:
loganhz 2018-01-15 17:10:37 +08:00
parent 4c17335b54
commit 94d5ef9cae
1 changed files with 11 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import { computed } from '@ember/object'; import { computed } from '@ember/object';
import { next } from '@ember/runloop';
import { inject as service } from '@ember/service'; import { inject as service } from '@ember/service';
import Component from '@ember/component'; import Component from '@ember/component';
import { get } from '@ember/object'; import { get } from '@ember/object';
@ -26,5 +27,14 @@ export default Component.extend({
this.set('password',''); this.set('password','');
this.sendAction('action', code); this.sendAction('action', code);
} }
} },
didInsertElement() {
next(() => {
if ( this.isDestroyed || this.isDestroying ) {
return;
}
this.$('INPUT')[0].focus();
});
},
}); });