From d6b1b55b185e3e9cf934c58f238453db247f83a3 Mon Sep 17 00:00:00 2001 From: aaronskiba Date: Thu, 13 Jun 2024 13:25:40 -0600 Subject: [PATCH] Fix `autoresize_min_height` console warning Prior to this change,`tinymceEditor.settings` was evaluating to `undefined`. Also, TinyMCE replaced `autoresize_min_height` replaced with `min_height` with the release of v5. We have `min_height` included in our defaultOptions object within `app/javascript/src/utils/tinymce.js`. The value of `min_height` appears to be performing the functionality that this removed code was attempting to. This change is more comprehensively documented here: https://github.com/DMPRoadmap/roadmap/issues/3424#issuecomment-2166552337 --- app/javascript/src/utils/conditionalFields.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/javascript/src/utils/conditionalFields.js b/app/javascript/src/utils/conditionalFields.js index d545a1a09..3ef53d7ac 100644 --- a/app/javascript/src/utils/conditionalFields.js +++ b/app/javascript/src/utils/conditionalFields.js @@ -15,14 +15,6 @@ export default function toggleConditionalFields(context, showThem) { if (container.length > 0) { if (showThem === true) { container.find('.toggleable-field').show(); - - // Resize any TinyMCE editors - container.find('.toggleable-field').find('.tinymce').each((_idx, el) => { - const tinymceEditor = Tinymce.findEditorById($(el).attr('id')); - if (tinymceEditor) { - $(tinymceEditor.iframeElement).height(tinymceEditor.settings.autoresize_min_height); - } - }); } else { // Clear the contents of any textarea select boxes or input fields container.find('.toggleable-field').find('input, textarea, select').val('').change();