<commit_before># ember-inline-edit

ember-inline-edit provides inline editing for your ember apps. Has basic keyboard support, too.

## Installation

`ember install ember-inline-edit`

## Usage

Use the `ember-inline-edit` component and provide it a default value.

```handlebars
  {{#ember-inline-edit
    value=value}}
```

This will give you a component that can be edited inline. By default, it is a textfield. You can, however, change the field type. Here's how:

```handlebars
  {{#ember-inline-edit
    value=value
    field='textarea'}}
```

This will make it a textarea. The current supported types are: text, email, phone, textarea (if you need more, feel free to create an issue).

It also exposes an action `onSave` that is called (with the value as an argument) when the user hits save. Here's how that works:

```handlebars
  {{#ember-inline-edit
    value=value
    field='textarea'
    onSave='changeValue'}}
```

Inside your route, you can handle the `saveModel` action like this:

```handlebars
  actions: {
    changeValue (val) {
      this.set('value', value)
    }
  }
```

By default, when the `value` is empty, it says 'Not provided'. You have the option to customize that. Here's how you can do that:

```handlebars
  {{#ember-inline-edit
    value=value
    emptyLabel='It is empty'
    field='textarea'
    onSave='changeValue'}}
```

With this, if the `value` is empty, it will show `It is empty` instead.

There's no styling provided by default. Feel free to add your own.

#### Keyboard Support

Inside the inputs (the textarea, input fields, etc.), if the user hits `esc`, it does exactly what a click on the save button would do (i.e. sends an `onSave` action and closes the editor).

If the user hits `esc`, the editor closes _without_ sending the `onSave` action.

## Issues? Bugs?<commit_msg>Changed typo on readme<commit_after># ember-inline-edit

ember-inline-edit provides inline editing for your ember apps. Has basic keyboard support, too.

## Installation

`ember install ember-inline-edit`

## Usage

Use the `ember-inline-edit` component and provide it a default value.

```handlebars
  {{#ember-inline-edit
    value=value}}
```

This will give you a component that can be edited inline. By default, it is a textfield. You can, however, change the field type. Here's how:

```handlebars
  {{#ember-inline-edit
    value=value
    field='textarea'}}
```

This will make it a textarea. The current supported types are: text, email, phone, textarea (if you need more, feel free to create an issue).

It also exposes an action `onSave` that is called (with the value as an argument) when the user hits save. Here's how that works:

```handlebars
  {{#ember-inline-edit
    value=value
    field='textarea'
    onSave='changeValue'}}
```

Inside your route, you can handle the `saveModel` action like this:

```handlebars
  actions: {
    changeValue (val) {
      this.set('value', value)
    }
  }
```

By default, when the `value` is empty, it says 'Not provided'. You have the option to customize that. Here's how you can do that:

```handlebars
  {{#ember-inline-edit
    value=value
    emptyLabel='It is empty'
    field='textarea'
    onSave='changeValue'}}
```

With this, if the `value` is empty, it will show `It is empty` instead.

There's no styling provided by default. Feel free to add your own.

#### Keyboard Support

Inside the inputs (the textarea, input fields, etc.), if the user hits `enter`, it does exactly what a click on the save button would do (i.e. sends an `onSave` action and closes the editor).

If the user hits `esc`, the editor closes _without_ sending the `onSave` action.

## Issues? Bugs?
{'fraction_non_alphanumeric': 0.10641200545702592, 'fraction_numerical': 0.0, 'mean_word_length': 3.8236842105263156, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1128050', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1073, 'n_words': 488}