1

I am using the following code to render a Modal window in Joomla! 3.6.5, inside administration:

echo '<a href="#modal-test-modal" role="button" class="btn btn-success" data-toggle="modal">Launch demo modal</a>';

$modalParams = array(
    'title'       => 'Test modal',
    'closeButton' => true,
    'url'         => 'http://joomla.org',
    'height'      => 600,
    'width'       => 600,
    'backdrop'    => true,
    'keyboard'    => true,
    'footer'      => '<div class="alert alert-info">Modal footer</div>'
);
$modalBody = '<div class="alert alert-success">Modal <strong>body!</strong></div>';

echo JHtml::_('bootstrap.renderModal', 'modal-test-modal', $modalParams, $modalBody);

The issue: At the first button click, the modal pops up, but the modal frame does not 'follow' the iframe content wrong image but if dismiss the modal and click again to open it, it will be correctly rendered. right image Is there a workaround for this?
EDIT: If browser is refreshed, the first click after, will be wrongly rendered, again

  • Your code works fine for me in Chrome and Firefox. What browser are you using? Have you added any bespoke css or javascript that could be causing conflicts? – Richard B Apr 5 '17 at 15:04
  • @Richard B Thank you. Tested with Chrome, Firefox,... with no luck and have no additional css or js. This only happens when the modal body have more than 400px height (I realized that the max-height is defined to 400px on Isis template, by default (line 3757)). In addition, If the browser is refreshed, the first click after, will be wrongly rendered, again. – n.h. Apr 5 '17 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.