Skip to content

Commit

Permalink
Fix autoresize_min_height console warning
Browse files Browse the repository at this point in the history
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: #3424 (comment)
  • Loading branch information
aaronskiba committed Jun 13, 2024
1 parent c515522 commit d6b1b55
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions app/javascript/src/utils/conditionalFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d6b1b55

Please sign in to comment.