Fix undefined branch in create-destination-dialog
Follow-up of change 234145, where I think this dialog was just overlooked. As in all the other dialogs the bare confirm event from gr-dialog must be prevented from propagating, so that the new detailed event is the only one handled by parent elements. Otherwise two 'confirm' events would be handled, and the one from gr-dialog does not have the 'branch' detail, so it would become undefined in the dialog. Bug: Issue 12024 Change-Id: I8374e9dbd27ec69972011e3cfed58acb0f7052d4
This commit is contained in:
@@ -50,9 +50,13 @@
|
||||
this.$.createOverlay.close();
|
||||
}
|
||||
|
||||
_pickerConfirm() {
|
||||
_pickerConfirm(e) {
|
||||
this.$.createOverlay.close();
|
||||
const detail = {repo: this._repo, branch: this._branch};
|
||||
// e is a 'confirm' event from gr-dialog. We want to fire a more detailed
|
||||
// 'confirm' event here, so let's stop propagation of the bare event.
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.dispatchEvent(new CustomEvent('confirm', {detail, bubbles: false}));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user