Support

Account

Home Forums Bug Reports Media modal empty when screen is below 400px height

Helping

Media modal empty when screen is below 400px height

  • Hello!

    I found a bug which is related to the mix of ACF and WP Admin-styling when using the media modal in WP Admin.

    My setup:
    WP 4.9.4
    ACF Pro 5.6.8
    MySQL 5.6.34
    PHP 7.0.3

    How to trigger:
    You need an image-field to test with. First select an image, then click the edit icon to change the image text etc. Then resize the height of the window to below 400px. Then the inner content of the modal disappears.

    The conflicting styling is happening in “wp-include/css/media-views.css:2468”.

    My temporary solution:
    Not a very good or smart one, but it works. Hoping that ACF will fix this.

    /**
     * Insert CSS to WP Admin which fixes bugs in ACF media modal when window has a very low height.
     */
    function acf_styling_fix_for_media_modal() {
    	?>
    	<style type="text/css">
    		@media only screen and (max-width: 640px), screen and (max-height: 400px) {
    			.acf-media-modal .media-sidebar {
    				bottom: 0 !important;
    				max-width: none !important;
    			}
    		}
    	</style>
    	<?php
    }
    add_action( 'admin_head', 'acf_styling_fix_for_media_modal' );
Viewing 1 post (of 1 total)

The topic ‘Media modal empty when screen is below 400px height’ is closed to new replies.