Modal popup getting closed when i click outside the popup window

I have a modal popup in my webpage. In the modal web block, I have a few combo boxes, input boxes and a submit button. In the Onchange event of the comboox, I have an action which refreshes the data of other combo boxes and refreshes the controls using ajax refresh. The popup works fine even when i click outside the popup window. 

The issue starts when i select any data in the combo box and perform a ajax refresh of the rest of the combo boxes. After this selection, when i click outside the popup window, the popup closes instantly . How to stop this behaviour? 

Hello Karthik.

The standard Modal (SilkUI) has the following behaviour.

You use the toggleModal action to open/close it.
But it has a background (semi-transparent layer) that covers the page, with an event listener associated to it, that calls the toogleModal action when you click in the background (outside the modal).

So the normal behaviour IS to the modal to close immediately when you click outside it.

If you're talking about the common POPUP (editor) window, it indeed shouldn't close because you click outside it, no matter if you are using Ajax inside it.

If it is the last case, could you provide a small working module that reproduces this behaviour?