Ember input autofocus component . Any Idea?


#1

I want ember input autofocus component. Do you have any idea ?


#2

Hi Vinoth, how about an auto-focusing custom component:

export default Ember.TextField.extend({
  doFocus: Ember.on('didInsertElement', function() {
    this.$().focus();
  })
});

#3

@emberigniter Previously I was using this autofocus component . In latest Ember 2.3.0 this “Ember.TextField” is deprecated ?


#4

Use the <input> ( or {{input}} ) element with the html5 autofocus attribute

try this

{{input type="text" autofocus="true"}}


#5

Really cool, I completely forgot about that autofocus attribute!

@vinothwindows47 It doesn’t look like deprecated: http://emberjs.com/api/classes/Ember.TextField.html