mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 19:06:09 +00:00
modal: Fix button height issue on modals with long text on submit button.
This commit fixes an issue where the button height increases while it has the spinner on modals with long text on the submit button. The issue occurred due to the button height being calculated after hiding the span element, which resulted in an incorrect height. To overcome this, the commit suggests computing the span element's height before hiding it to ensure that the button height is accurately set.
This commit is contained in:
@@ -79,13 +79,17 @@ export function hide_dialog_spinner(): void {
|
||||
}
|
||||
|
||||
export function show_dialog_spinner(): void {
|
||||
$(".dialog_submit_button span").hide();
|
||||
// Disable both the buttons.
|
||||
$("#dialog_widget_modal .modal__btn").prop("disabled", true);
|
||||
|
||||
const $spinner = $("#dialog_widget_modal .modal__spinner");
|
||||
const dialog_submit_button_span_width = $(".dialog_submit_button span").width();
|
||||
const dialog_submit_button_span_height = $(".dialog_submit_button span").height();
|
||||
|
||||
// Hide the submit button after computing its height, since submit
|
||||
// buttons with long text might affect the size of the button.
|
||||
$(".dialog_submit_button span").hide();
|
||||
|
||||
loading.make_indicator($spinner, {
|
||||
width: dialog_submit_button_span_width,
|
||||
height: dialog_submit_button_span_height,
|
||||
|
||||
Reference in New Issue
Block a user