1.3.2 • Published 6 years ago

ember-autoresize v1.3.2

Weekly downloads
6,006
License
MIT
Repository
github
Last release
6 years ago

Ember AutoResize Ember Observer Score Code Climate

Greenkeeper badge

Note: if you're using a version of Ember less than 1.12.0, then please use 0.4.1 of this addon.

Ember AutoResize is an Ember-CLI addon for providing autoresize functionality to Ember. This package currently provides the necessary bootstrapping for {{input}} and {{textarea}} components.

To play with the addon, look at our demo. (Note: The demo is a bit out of date, check the documentation below for proper usage.)

Usage

To enable autoresizing on an input, add the following to your handlebars:

{{input autoresize=true}}

Refresh your page, and you should see that when you type in your text field, it automatically resizes to fit the text.

Textareas work exactly the same way:

{{textarea autoresize=true}}

Options

max-width

Set the maximum width of the resizeable element. If no unit is provided, it assumes that it's in pixels.

{{input autoresize=true max-width=200}}

max-height

Set the maximum width of the element. If no unit is provided, it assumes that it's in pixels.

{{input autoresize=true max-height=300}}

rows

Set the minimum number of rows for the element. Recommended for textareas.

{{textarea autoresize=true rows=2}}

max-rows

Set the maximum number of rows for the element. Recommended for textareas.

{{textarea autoresize=true max-rows=10}}

If you are making custom inputs using raw DOM elements, you can still use autoresize by specifying a custom autoresizeElement when you mixin the autoresize to your component.

import Ember from 'ember';

export default Ember.Component.extend({
  autoresizeElementDidChange: on('didInsertElement', function () {
    set(this, 'autoresizeElement', this.$('input')[0]);
  })
});

Installation

ember install ember-autoresize

Roadmap

  • Optimize style lookups
  • Font fitting
  • Clearer ways to enable autoresizing on templates

Contributing

Contributors are welcome! Please provide a reproducible test case. Details will be worked out on a case-per-case basis. Maintainers will get in touch when they can, so delays are possible. For contribution guidelines, see the code of conduct.

Publishing Documentation

To publish documentation (under the tests/dummy directory) run the following command:

npm run-script publish-docs
1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.22

7 years ago

0.5.21

7 years ago

0.5.20

7 years ago

0.5.19

7 years ago

0.5.18

7 years ago

0.5.17

8 years ago

0.5.16

8 years ago

0.5.15

8 years ago

0.5.14

8 years ago

0.5.13

8 years ago

0.5.12

9 years ago

0.5.11

9 years ago

0.5.10

9 years ago

0.5.9

9 years ago

0.5.8

9 years ago

0.5.7

9 years ago

0.5.6

9 years ago

0.5.5

9 years ago

0.5.4

9 years ago

0.5.3

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.6

9 years ago

0.3.5

9 years ago

0.3.4

9 years ago

0.3.3

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago