GithubHelp home page GithubHelp logo

ehkasper / react-tinymce-input Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hurricanejames/react-tinymce-input

0.0 1.0 0.0 399 KB

A React Component to Control a TinyMCE Input

JavaScript 98.76% CSS 1.13% HTML 0.09% Shell 0.02%

react-tinymce-input's Introduction

React TinyMCE Input

npm package

React-TinyMCE-Input was written to use a TinyMCE input from within React. It is not the first, and is unlikely to be the last. If you are looking for a bare metal implementation, there is another great component, react-tinymce (demo). React-Tinymce is awesome, but was too low level to work for me. I wanted something that was a bit more React like.

React-TinyMCE-Input handles a lot of the boilerplate. It tried to bind to the editor events that cause changes to the content and tell React when content changes. It also tried to keep TinyMCE in sync with changes coming from React.

Using React-TinyMCE-Input.

var TinyMCEInput = require('react-tinymce-input');
<TinyMCEInput value={this.state.value} onChange={this.onTinyMCEChange} tinymceConfig={this.props.tinymceConfig} />

There are a few other props, and it is possible to listen for most events.

Note: the onChange event handler take a single param, a string with the updated content. The other event handlers all receive TinyMCE events. At some point, I may upgrade this to use React's synthetic event system, but currently it is unneeded.

Examples

git clone https://github.com/HurricaneJames/react-tinymce-input.git
cd react-tinymce-input
npm install
npm run dev
open localhost:8090

ChangeLog

  • 1.2.0 passthroughs

    • added onClick prop that will bind to the 'click' event on the tinymce editor
    • added textareaProps prop that will pass through to the textarea
    • added otherEventHandlers prop that takes an Object<string, Function>. Each key in otherEventHandlers will be bound to the TinyMCE editor. This is direct access to the TinyMCE event binding for any future enhancements that might be required before they can be added as a direct prop on the TinyMCEInput component.
  • 1.0.5 mitigate textarea blink

    • Update to initialize tinymce immediately if already defined (no more 100ms delay).
    • Pseudo-hide the textarea. The TinyMCE editor will appear to "pop-in", but the textarea will not be visible before
  • 1.0.1 Add onSetupEditor prop to allow editor configuration

  • 1.0.0 Initial Release

react-tinymce-input's People

Contributors

hurricanejames avatar wmertens avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.