You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP

draft-js-multiline-list-item-plugin

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

draft-js-multiline-list-item-plugin

Multiline list item Plugin for DraftJS

1.0.1
Version published
Weekly downloads
16
-23.81%
Maintainers
1
Weekly downloads
 
Created

Draft.js MultiLine List Item plugin

This is a plugin for the draft-js-plugins-editor, a plugin system that sits on top of Draft.js.

By default DraftJS doesn't allow you to have multiline items in lists - when you press Shift+Return it still adds a new list item.

This plugin adds behaviour to the editor to stay on the same list item and include a so called 'soft newline' into the list item on Shift+Return press.

Usage

npm i --save draft-js-multiline-list-item-plugin

then import the plugin creator function

import createMultilineListItemPlugin from 'draft-js-multiline-list-item-plugin'
const multiLineListItemPlugin = createMultilineListItemPlugin()

This can then be passed into a draft-js-plugins-editor component:

import createMultilineListItemPlugin from 'draft-js-multiline-list-item-plugin'
import Editor from 'draft-js-plugins-editor'

const multiLineListItemPlugin = createMultilineListItemPlugin()
const plugins = [multiLineListItemPlugin]

<Editor plugins={plugins} />

FAQs

Package last updated on 18 Aug 2018

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