{"id":15603549,"url":"https://github.com/st-h/ember-content-editable","last_synced_at":"2025-04-09T16:19:55.406Z","repository":{"id":35739013,"uuid":"40017844","full_name":"st-h/ember-content-editable","owner":"st-h","description":"A contenteditable component for ember-cli that just works™","archived":false,"fork":false,"pushed_at":"2023-08-11T11:07:18.000Z","size":4934,"stargazers_count":66,"open_issues_count":3,"forks_count":31,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T16:19:51.163Z","etag":null,"topics":["contenteditable","ember-cli"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/st-h.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-31T17:57:13.000Z","updated_at":"2024-06-27T11:08:57.000Z","dependencies_parsed_at":"2024-06-18T16:51:11.090Z","dependency_job_id":"8249d789-0a90-4abd-b29b-58f346e2ff2e","html_url":"https://github.com/st-h/ember-content-editable","commit_stats":{"total_commits":225,"total_committers":20,"mean_commits":11.25,"dds":0.6711111111111111,"last_synced_commit":"1aed138bffaae6720057e0d014ad97b0646b46f9"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st-h%2Fember-content-editable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st-h%2Fember-content-editable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st-h%2Fember-content-editable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st-h%2Fember-content-editable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/st-h","download_url":"https://codeload.github.com/st-h/ember-content-editable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065281,"owners_count":21041872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contenteditable","ember-cli"],"created_at":"2024-10-03T03:03:56.932Z","updated_at":"2025-04-09T16:19:55.383Z","avatar_url":"https://github.com/st-h.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ember-content-editable\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/st-h/ember-content-editable.svg)](https://greenkeeper.io/)\n[![Latest NPM release][npm-badge]][npm-badge-url]\n[![TravisCI Build Status][travis-badge]][travis-badge-url]\n[![Coverage Status](https://coveralls.io/repos/github/st-h/ember-content-editable/badge.svg?branch=master)](https://coveralls.io/github/st-h/ember-content-editable?branch=master)\n[![Code Climate][codeclimate-badge]][codeclimate-badge-url]\n[![Ember Observer Score][ember-observer-badge]][ember-observer-badge-url]\n[![Dependencies][dependencies-badge]][dependencies-badge-url]\n[![Dev Dependencies][devDependencies-badge]][devDependencies-badge-url]\n\nEmber cli contenteditable component, with placeholder and value binding. Use it just like an `input` or `textarea`, but it will autoresize for you.\n\n## Compatibility\n\n* Ember.js v4.4 or above\n* Ember CLI v4.4 or above\n* Node.js v14 or above\n\n### Versions\n\nVersion 3.0.0 targets ember octane apps only. If you need support for older ember versions, please see previous versions of this addon. Version 3.0.0 is based on the [ember-content-editable-modifier](https://github.com/st-h/ember-content-editable-modifier) addon.\n\nMajor changes as of **3.0.0**:\n- *Breaking*: it is no longer possible to use two way binding within components, so consuming apps need to handle updates by providing a @onChange function!\n- *Breaking*: event handler names are changed to follow a consistent pattern\n- internal rewrite\n\n## Demo\n\nOur demo page can be found [here](http://st-h.github.io/ember-content-editable/)\n\n## Installation\n\n`ember install ember-content-editable`\n\n## Usage\n\nUse it just like `input` or `textarea`:\n\n```\n\u003cContentEditable @value={{this.value}} @onChange={{fn (mut this.value)}} @placeholder=\"Your name\"/\u003e\n```\n\n### Options\n\nOption Name          | Description                                    | Default\n---------------------|------------------------------------------------|---------\nvalue                | The value to be edited                         | `\"\"`\nplaceholder          | Placeholder displayed when value is blank      | `\"\"`\nspellcheck           | Uses browsers spellcheck, same as with `\u003cinput\u003e` | none\ndisabled             | If true, element can't be edited, focused or tabbed to | false\nmaxlength            | Maximum length of the input, in characters     | none\nallowNewlines        | If false, linebreaks can't be entered          | true\nautofocus            | If true, the element will be focused once inserted into the document | false\nclearPlaceholderOnFocus | If true, the placeholder will be cleared as soon as the element gains focus (even if no content is present yet) | false\n\n\n### Events\n\nThis addon supports events supported by the ember component model (except for keyboard events). See the ember documentation for details or the dummy app within the test folder for an example. As this addon uses keyboard events slightly renamed hooks are available as making use of the default hooks would override the addons implementation.\n\nevent | description | argument\n-- | -- | --\n**onLengthExceeded** | if `maxlength` is set, every action that exceeds the limit triggers this event | total numbers of character entered (number)\n**onEnter** | triggers when the enter key is pressed | event\n**onEscape** | triggers when the escape key is pressed | event\n**onKey** | keydown event propagation | event\n**onPaste** | triggers when content is pasted successfully (does not fire when maxlength is exceeded) | pasted text content (string)\n\n### Customizing Placeholder Color\n\n```\n.ember-content-editable:empty {\n  color: rgba(0,0,0,0.6);\n}\n```\n\n## Common Problems\n\nThese are some solutions to common problems browsers have with contenteditable elements.\n\n### Tab Index\n\nThe `tabindex` attribute is bound to the element in the DOM, but only [certain tags support it](http://www.w3.org/TR/html4/interact/forms.html#adef-tabindex).\n\n\u003eThe following elements support the tabindex attribute: A, AREA, BUTTON, INPUT, OBJECT, SELECT, and TEXTAREA.\n\nSo to use `tabindex`, you'll also need to set `tagName` to one of those.\n\n### Newlines aren't showing\n\nTry using `whitespace: pre-line;` or `whitespace: pre-wrap;` in your CSS.\n\n### I can't blur the element\n\nA solution to this is to call `window.getSelection().removeAllRanges()` after you call `blur()` on the element.\n\nFor example, if you have `enter='endEditing'` on your content-editable, the following action would prevent the newline and blur the element.\n\n```\nendEditing(contentEditable, event) {\n  event.preventDefault();\n  contentEditable.element.blur();\n  window.getSelection().removeAllRanges();\n}\n```\n\n### Cursor appears too big when element is empty\n\nSetting `display: block;` in CSS seems to solve this.\n\n## Acknowledements\n\n[AddJAm](https://github.com/AddJAm) has done a great job writing and maintaining this addon for a long time in the past. Thanks guys.\n\n## Contributions\n\nIf you want to report a bug, please open a new issue. Any bugs that are not totally obvious should include a way to reproduce the issue (like ember-twiddle) or a failing test. Or even better, provide a PR which tests and fixes the issue.\n\nIn case you find there is a feature missing, please provide a PR with corresponding test coverage. Please keep in mind to keep addons lightweight. If in doubt, open an issue first and see what others think about it.\n\n[npm-badge]: https://img.shields.io/npm/v/ember-content-editable.svg\n[npm-badge-url]: https://www.npmjs.com/package/ember-content-editable\n[travis-badge]: https://img.shields.io/travis/st-h/ember-content-editable/master.svg?label=TravisCI\n[travis-badge-url]: https://travis-ci.org/st-h/ember-content-editable\n[codeclimate-badge]: https://api.codeclimate.com/v1/badges/8688ab1cea89cb7cb918/maintainability\n[codeclimate-badge-url]: https://codeclimate.com/github/st-h/ember-content-editable/maintainability\n[ember-observer-badge]: http://emberobserver.com/badges/ember-content-editable.svg\n[ember-observer-badge-url]: http://emberobserver.com/addons/ember-content-editable\n[dependencies-badge]: https://img.shields.io/david/st-h/ember-content-editable.svg\n[dependencies-badge-url]: https://david-dm.org/st-h/ember-content-editable\n[devDependencies-badge]: https://img.shields.io/david/dev/st-h/ember-content-editable.svg\n[devDependencies-badge-url]: https://david-dm.org/st-h/ember-content-editable#info=devDependencies\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst-h%2Fember-content-editable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fst-h%2Fember-content-editable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst-h%2Fember-content-editable/lists"}