From db74a23f9b82c8ab3e03a9ceb5eac9d5f2739412 Mon Sep 17 00:00:00 2001 From: Muhammad Afaq Shuaib Date: Thu, 14 Nov 2024 23:32:25 +0500 Subject: [PATCH] chore: add resize option to adjust the height of tinymce editor manually (#992) --- .../__snapshots__/RichEditor.test.jsx.snap | 24 +++++++++++++++---- src/components/RichEditor/index.jsx | 6 ++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/components/RichEditor/__snapshots__/RichEditor.test.jsx.snap b/src/components/RichEditor/__snapshots__/RichEditor.test.jsx.snap index cfe111301..8ee528356 100644 --- a/src/components/RichEditor/__snapshots__/RichEditor.test.jsx.snap +++ b/src/components/RichEditor/__snapshots__/RichEditor.test.jsx.snap @@ -24,12 +24,16 @@ exports[`RichEditor shows a rich text editor and an error 1`] = ` "content_css": false, "content_style": "", "default_link_target": "_blank", + "elementpath": false, "entity_encoding": "raw", "extended_valid_elements": "span[lang|id] -span", + "max_height": 500, "menubar": false, + "min_height": 200, "plugins": "legacyoutput link lists language directionality", + "resize": "vertical", "selector": "#rich-text-editor-test", - "statusbar": false, + "statusbar": true, "toolbar": "undo redo | bold italic underline | bullist numlist | link | language | ltr rtl", } } @@ -72,12 +76,16 @@ exports[`RichEditor shows a rich text editor with default text value 1`] = ` "content_css": false, "content_style": "", "default_link_target": "_blank", + "elementpath": false, "entity_encoding": "raw", "extended_valid_elements": "span[lang|id] -span", + "max_height": 500, "menubar": false, + "min_height": 200, "plugins": "legacyoutput link lists language directionality", + "resize": "vertical", "selector": "#rich-text-editor-test", - "statusbar": false, + "statusbar": true, "toolbar": "undo redo | bold italic underline | bullist numlist | link | language | ltr rtl", } } @@ -118,12 +126,16 @@ exports[`RichEditor shows a rich text editor with no default text value 1`] = ` "content_css": false, "content_style": "", "default_link_target": "_blank", + "elementpath": false, "entity_encoding": "raw", "extended_valid_elements": "span[lang|id] -span", + "max_height": 500, "menubar": false, + "min_height": 200, "plugins": "legacyoutput link lists language directionality", + "resize": "vertical", "selector": "#rich-text-editor-test", - "statusbar": false, + "statusbar": true, "toolbar": "undo redo | bold italic underline | bullist numlist | link | language | ltr rtl", } } @@ -166,12 +178,16 @@ exports[`RichEditor shows a rich text editor with no maxChars 1`] = ` "content_css": false, "content_style": "", "default_link_target": "_blank", + "elementpath": false, "entity_encoding": "raw", "extended_valid_elements": "span[lang|id] -span", + "max_height": 500, "menubar": false, + "min_height": 200, "plugins": "legacyoutput link lists language directionality", + "resize": "vertical", "selector": "#rich-text-editor-test", - "statusbar": false, + "statusbar": true, "toolbar": "undo redo | bold italic underline | bullist numlist | link | language | ltr rtl", } } diff --git a/src/components/RichEditor/index.jsx b/src/components/RichEditor/index.jsx index dfc525885..5f33f710e 100644 --- a/src/components/RichEditor/index.jsx +++ b/src/components/RichEditor/index.jsx @@ -90,8 +90,12 @@ class RichEditor extends React.Component { branding: false, menubar: false, plugins: 'legacyoutput link lists language directionality', - statusbar: false, + statusbar: true, + elementpath: false, + resize: 'vertical', selector: `#${id}`, + min_height: 200, + max_height: 500, toolbar: 'undo redo | bold italic underline | bullist numlist | link | language | ltr rtl', entity_encoding: 'raw', extended_valid_elements: 'span[lang|id] -span',