Closed DivyaPrabhakar closed 8 years ago
In a little more detail, here's what we found was happening:
window
(in the bubble phase, and in the same frame), which will close the dialog when the window
receives a click event.window
, which now has a click
event handler which dismisses the dialog. :black_large_square: Our hypothesis is that action execution was previously running asynchronously and in a different frame from the event propagation, but that a recent bluebird upgrade changed this so that it started running in the same frame. And, indeed, petkaantonov/bluebird#915 supports this hypothesis. The "fix" is to ensure that the important part of the dialog open work happens in a different frame to ensure that any event handler that prompted a dialog open is not processed by the event handlers attached by the dialog, which are all intended to only act upon later events.
References #3532
With the previous version of bluebird, the call to
_addListeners()
was working asynchronously behind the scenes. Therefore the click events on the document header we handled before an event listener was added on the window. With this recent change to bluebird, https://github.com/petkaantonov/bluebird/issues/915, this became synchronous and the event listener on the window was added before the click to open the document header buttons were interpreted, resulting in the automatic toggle. This PR makes the addition of event listeners in thecomponentDidUpdate
asynchronous again.