ui
ui copied to clipboard
JS render must be reordered
repro code:
$modal = Modal::addTo($app);
$modal->set(function (View $p) {
Message::addTo($p, ['test']);
});
$modal->js(true)->modal('show');
$button = Button::addTo($app)->set('Test');
$button->on('click', $modal->jsShow());
I would expect modal with message displayed, but empty modal is shown instead.

the problem is:

the show JS code must be rendered after modal is configured
notice, when modal is closed and reopened by the button, message is rendered:

notice also the first problem corrupts the top left/right modal rounded corners