Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-content-editable-modifier

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-content-editable-modifier

An ember modifier that enables contenteditable fields

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ember-content-editable-modifier

Greenkeeper badge Latest NPM release ![Code Climate][codeclimate-badge] Ember Observer Score Dependencies Dev Dependencies

This addons allows you to add contenteditable functionality to dom elements by providing an ember modifier.

Compatibility

  • Ember.js v4.4 or above
  • Ember CLI v4.4 or above
  • Node.js v14 or above

If you need support for older ember versions, please check version 2.0.0-rc.0 or 1.0.5

Installation

ember install ember-content-editable

Usage

Just apply the content-editable modifier and provide a value attribute and a onChange function in order to update the value. Ember does not allow for two way bindings, therefore you will need to take care of updating the value yourself.

Simplest use case

<div {{content-editable value=this.myText onChange=(fn (mut this.myText))}}></div>

However, it is recommended to use a setter in order to update your variable. Additionally it is recommended to create an ember component around above statement in order to provide further customizations and features that you need for your app.

Additional attributes

autofocus: If true, the element will be focused once inserted into the document

placeholder: Placeholder displayed when value is blank

Clear the placeholder on focus

Add the following css code to your app:

.ember-content-editable:empty:focus:before {
  content: '';
}

Contributing

Please send PRs. However, this addon aims to provide basic contenteditable functionality only, which can easily be extended by using custom components. Otherwise see the Contributing guide for details.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 26 Jan 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc