🚀 Launch Week Day 5:Introducing Immutable Scans.Learn More →
Socket
Book a DemoInstallSign in
Socket

quill-form

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quill-form

Quill Extension for Form Bindings

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

Quill Form

Module for simple form and input field bindings in Quill. Automatically creates hidden input fields for a form and adds submit handling and submit by key (⌘/Ctrl+S). You may also specify your own custom input fields. It creates fields for text, html and delta.

Installation

Yarn

yarn add quill-form

NPM

npm i quill-form

Usage

To add quill-form to your Quill, simply add the javascript after quill or import it in your project. Make sure that your editor is placed within a form or specify custom input fields.

<body>
  ...
  <form action="#" method="get">
    <div id="editor-container"></div>
  </form>
  ...
  <script src="/path/to/quill.min.js"></script>
  <script src="/path/to/quill-form.js"></script>
  <script>
    var editor = new Quill('#editor-container', {
      modules: {
        form: true
      }
    });
  </script>
  ...
</body>

Options

Specify one option or more to override defaults.

var editor = new Quill('#editor-container', {
  modules: {
    form: {
      htmlField: 'html', // Input name string, HTMLElement or false
      deltaField: 'delta', // Input name string, HTMLElement or false
      textField: 'text', // Input name string, HTMLElement or false
      submitKey: { // Keyboard key binding object or false
        key: 'S',
        shortKey: true
      },
      updateOnBlur: true, // Updates the fields on blur
      updateOnChange: false // Updates the fields on every change
    }
  }
});

Keywords

form

FAQs

Package last updated on 27 Sep 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