Socket
Socket
Sign inDemoInstall

ember-auto-focus

Package Overview
Dependencies
187
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ember-auto-focus

An HTML autofocus solution for Ember apps


Version published
Weekly downloads
27
increased by2600%
Maintainers
1
Install size
14.6 MB
Created
Weekly downloads
 

Readme

Source

ember-auto-focus

       

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.

Example

When the auto-focus element is inserted, it will attempt to focus the first child contained within it:

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

Alternatively, you can pass in a selector:

{{#auto-focus '.my-child'}}
  <div class="my-child" tabindex=0></div>
{{/auto-focus}}

You can set the disabled attribute to true to prevent autofocusing:

{{#auto-focus disabled=shouldAutoFocus}}
   ...
{{/auto-focus}}

Installation

ember install ember-auto-focus

Keywords

FAQs

Last updated on 02 Dec 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc