0.0.3 • Published 8 years ago

@amk221/ember-autofocus v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

ember-autofocus

       

HTML's autofocus attribute focuses an element on page load.

However, in single page apps the page load event only happens once - so autofocus pretty much becomes useless.

This addon provides you with a helper that focuses the first child contained within it.

Example

{{#if showField}}
  {{#auto-focus}}
    <input>
  {{/auto-focus}}
{{/if}}

Optionally, you can set the disabled attribute to true to prevent autofocusing.

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.