Skip to content

Commit

Permalink
Update to v4.1.0 (#373)
Browse files Browse the repository at this point in the history
* Readme file updated for react set up

* Updated the doc with proper formatting & segregation

* Handled double render for div tag

* Double render issue for textarea & other tag handled

* Update to v4.1.0

---------

Co-authored-by: shrutichatti <[email protected]>
  • Loading branch information
harasunu-narayan and shrutichatti authored Jul 12, 2023
1 parent 87d0038 commit 400d5a3
Show file tree
Hide file tree
Showing 8 changed files with 318 additions and 175 deletions.
458 changes: 292 additions & 166 deletions Readme.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/src/init_on_button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/froala_style.css';
import 'file-loader?name=[name].[ext]!./init_on_button.html';

import 'froala-editor/js/plugins.pkgd.min.js';
import FroalaEditorButton from 'react-froala-wysiwyg/FroalaEditorButton';
import React from 'react';
import ReactDOM from 'react-dom';
Expand Down
1 change: 1 addition & 0 deletions demo/src/init_on_image.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/froala_style.css';
import 'froala-editor/js/plugins.pkgd.min.js';
import 'file-loader?name=[name].[ext]!./init_on_image.html';


Expand Down
2 changes: 1 addition & 1 deletion demo/src/init_on_input.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Note that Froala Editor has to be required separately
import 'froala-editor/css/froala_editor.pkgd.min.css';

import 'froala-editor/js/plugins.pkgd.min.js';
import 'froala-editor/css/froala_style.css';
import 'file-loader?name=[name].[ext]!./init_on_input.html';

Expand Down
2 changes: 1 addition & 1 deletion demo/src/init_on_link.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/froala_style.css';

import 'froala-editor/js/plugins.pkgd.min.js';


import FroalaEditorA from 'react-froala-wysiwyg/FroalaEditorA';
Expand Down
22 changes: 19 additions & 3 deletions lib/FroalaEditorFunctionality.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,19 @@ export default class FroalaEditorFunctionality extends React.Component {
this.listeningEvents.length = 0;
this.element = null;
this.editorInitialized = false;
this.config = {
immediateReactModelUpdate: false,
reactIgnoreAttrs: null
};
let tagName = this.el.tagName.toLowerCase();
if (this.SPECIAL_TAGS.indexOf(tagName) == -1) {
if(this.editor && this.editor.destrying && !this.props.onManualControllerReady && this.tag == 'textarea'){
this.editor.$box.remove()
}
}
if(this.tag != 'textarea'){
this.editor.$wp = '';
}
}
}

Expand Down Expand Up @@ -262,9 +275,12 @@ export default class FroalaEditorFunctionality extends React.Component {
let self = this;

// bind contentChange and keyup event to froalaModel
this.editor.events.on('contentChanged', function () {
self.updateModel();
});
if(this.editor && this.editor.events){
this.editor.events.on('contentChanged', function () {
self.updateModel();
});
}

if (this.config.immediateReactModelUpdate) {
this.editor.events.on('keyup', function () {
self.updateModel();
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-froala-wysiwyg",
"version": "4.0.19",
"version": "4.1.0",
"description": "React component for Froala WYSIWYG HTML rich text editor.",
"main": "index.js",
"types": "./lib/index.d.ts",
Expand All @@ -23,7 +23,7 @@
},
"dependencies": {
"create-react-class": "^15.5.2",
"froala-editor": "4.0.19"
"froala-editor": "4.1.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"dev": "1",
"qa": "2",
"qe": "2",
"stg": "1"
"stg": "2"
}

0 comments on commit 400d5a3

Please sign in to comment.