ember-cli-focus-input

2.2.0 • Public • Published

Ember-cli-focus-input

Build Status NPM Downloads

Description

Ember-cli-focus-input is a set of ember components that provide autofocus (the first input of your form/page).

Why? There's the HTML5 input autofocus attribute!

The HTML5 input autofocus attribute does not work properly for Ember applications. It just lets you specify that a form control should have input focus when the page loads. That's why the attribute does not work properly for single page applications (SPA's).

Installation

As any other ember-cli addon, run:

$ ember install ember-cli-focus-input

Focus Input

{{focus-input value=model.field class="foo"}}

By default the input will be focused and have the content selected. If you prefer not to have the text selected/highlighted configure it like so.

{{focus-input value=model.field class="foo" select="false"}}

Focus Button

{{focus-button value=model.buttonField class="bar"}}

Running Tests

npm install (or yarn install)
ember test
ember try:each (test against multiple ember versions defined in config/ember-try.js)

License

Copyright © 2016 Brandon Williams http://williamsbdev.com

Licensed under the MIT License

Package Sidebar

Install

npm i ember-cli-focus-input

Weekly Downloads

9

Version

2.2.0

License

MIT

Unpacked Size

5.39 kB

Total Files

9

Last publish

Collaborators

  • toranb
  • williamsbdev