microsoft / microsoft/powerbi-visuals-api
Closing dialog box bug in Power Bi Desktop
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 108
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
Hello
I'm developing a custom visual that uses a dialog box, following the instructions here:
https://learn.microsoft.com/en-us/power-bi/developer/visuals/create-display-dialog-box
In that documentation, it is mentioned that you can close the dialog box by calling the:
IDialogHost.close(actionId: DialogAction, result?:object)
method, but that there is a delay of five seconds after the dialog box has opened before you can close it this way, here's the relevant passage from the docs:
You can also program the dialog box to automatically close by calling the IDialogHost close method. This method is blocked for five seconds after the dialog is opened, so that the earliest you can automatically close the dialog box is five seconds after it was initiated.
However, while this seems to work perfectly as advertised in the web version of Power Bi, there seems to be something broken when that method is used in Power Bi Desktop.
In particular, when using Power Bi Desktop I'm experiencing a very long delay (even 20-30 seconds) between calling the close() method and the dialog box actually closing. Furthermore, this delay happens even if the 5 seconds mentioned in the docs have passed, it does not seem tied to that timer at all, it just takes a very long time to close regardless of how long the dialog box has been open.
Is this a bug? Am I missing something?
Here some more info:
- Using API versione 5.3.0
- Tested on latest available version of Power Bi at time of writing
- Only affects Power Bi Desktop, works as intended in the web version
- This does not happen if using the native dialog buttons, it only happens when closing the popup via code with the
IDialogHost.close(...)method
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Power BI dialog documentation and the IDialogHost.close(actionId, result?) entry point. Reproduce the delayed programmatic close in Power BI Desktop using API version 5.3.0, then compare it with the web version and native dialog buttons. Done means identifying the cause and resolving the Desktop-only delay without changing the documented five-second behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100