Support

Account

Forum Replies Created

  • @steadyrain did you figure this out or is there any help from the acf team on how to do this?

    Just ran into this issue on a project.

  • This is how Ive handled fitting wysiwyg editors height to its content, with a fallback to a min height.

    		if ( typeof acf !== 'undefined' ) {
    		acf.add_action( 'wysiwyg_tinymce_init', function( ed, id, mceInit, $field ) {
    
    			// set height of wysiwyg on frontend
    			var minHeight = 200;
    			var mceHeight = $( ed.iframeElement ).contents().find( 'html' ).height() || minHeight;
    
    			if ( mceHeight < minHeight ) {
    				mceHeight = minHeight;
    			}
    
    			$( ed.iframeElement ).css( 'height', mceHeight );
    		} );
    	}
Viewing 2 posts - 1 through 2 (of 2 total)