# Modal dialog and long editDocument operation in the same UI event

**URL:** <https://forums.creativeclouddeveloper.com/t/modal-dialog-and-long-editdocument-operation-in-the-same-ui-event/3696>\
**Category:** UXP Plugin API\
**Tags:** react, ui, javascript\
**Created:** [October 2, 2021, 8:00pm UTC](https://forums.creativeclouddeveloper.com/t/modal-dialog-and-long-editdocument-operation-in-the-same-ui-event/3696 "2021-10-02T20:00:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/vikas/32/983_2.png) [@vikas](https://forums.creativeclouddeveloper.com/u/vikas)\
**Post date:** [October 2, 2021, 8:00pm UTC](https://forums.creativeclouddeveloper.com/t/modal-dialog-and-long-editdocument-operation-in-the-same-ui-event/3696/1 "2021-10-02T20:00:57Z")

</div>

Problem:  
I can’t do the editDocument operation and show a modal dialog in the same Ui event from a Panel.

Launching the operation and dialog from the same UI event handler results into dialog not being shown. Instead the default “Plugin is working” dialog is shown,

If I launch the editDocument operation from the click handler of a button inside the modal dialog, the operation works.

How can I avoid the default “Plugin is working” dialog and instead show my custom dialog and still do the long editDocument operation?
