FastGridTemplate .open_modal() method always have a long horizontal modal, which I fail to remove.

Dear all,

I am encountering something weird when using FastGridTemplate with pn.modal:
I have a few pn.Column allocated in a FastGridTemplate.
I now wish to create a modal that can cover the whole template and put the triggering button somewhere, maybe in one of the columns.
Here is the code:

        w1 = pn.widgets.TextInput(name='Config file name:')
        w2 = pn.widgets.Button(name='Download')
        config_file_name_modal = pn.Modal(w1, w2, name='config_filename_input', margin=20)

        download_config_button = pn.widgets.Button(
            name="Download config",
            button_type="primary",
        )
        download_config_button.on_click(
            lambda event: (
                self.template.open_modal(), #type:ignore
                config_file_name_modal.show()
            )
        )

Later on this button is added into one of the column, and the modal is added into the template with the following code:

        template.modal.clear()
        template.modal.append(config_file_name_modal)

So now my app works fine, in the sense that clicking this button can open the modal layer of the template, and my modal is shown as expected.
But this is always this long horizontal modal, which I fail to remove…below is a screenshot:

Am I doing something wrong? Is this a known problem?

Many thanks!
Z.

The above image does not show the unwanted modal clearly, because my custom modal is on top, here is when I close the custom modal: