microsoft / azure-devops-extension-sdk

Client SDK for developing Azure DevOps extensions
MIT License
126 stars 40 forks source link

unable to set the openCustomDialog size in dialogOptions #115

Open shrutikakhadyeCBRE opened 1 month ago

shrutikakhadyeCBRE commented 1 month ago

We want to implement a Modal in ADO plugin where we should be able to update the Modal size ie. The height and the width.

As there was the modal size issue, we were using panels as an alternative option.

We are using "ms.vss-features.host-dialog-service" service and openCustomDialog method for implementing the Modal in our extension.

Below is the code snippet for openCustomDialog method.

import * as SDK from "azure-devops-extension-sdk"; SDK.init();

const openDialog = async() => {

const dialogService = await SDK.getService( "ms.vss-features.host-dialog-service" ); await dialogService.openCustomDialog(context.id + ".registration-form", { message: "This is a custom message", title: "Improve Form", configuration: { isModalOpen: true }, onClose: (result) => { if (result !== undefined) { console.log("Dialog result:", result); } }, }); }

openDialog();

Also, we don’t have an option in the interface to manage the size of the Modal https://learn.microsoft.com/en-us/javascript/api/azure-devops-extension-api/idialogoptions

Can someone help me with fixing this issue?

jan-machacek commented 3 days ago

You can set Height of dialog after init. But you cannot set width, it is always 480px defined by parent element of frame which render dialog.

await SDK.notifyLoadSucceeded().then(() => { SDK.resize(undefined, 500); });