diff --git a/src/sap.m/src/sap/m/SelectDialog.js b/src/sap.m/src/sap/m/SelectDialog.js index b83c23ef8f0c..4f27d1d04d32 100644 --- a/src/sap.m/src/sap/m/SelectDialog.js +++ b/src/sap.m/src/sap/m/SelectDialog.js @@ -1052,7 +1052,20 @@ function( if (!this._oClearButton) { this._oClearButton = new Button(this.getId() + "-clear", { text: this._oRb.getText("SELECTDIALOG_CLEARBUTTON"), - press: this.clearSelection.bind(this) + press: function() { + this.clearSelection(); + if (!this.getMultiSelect()) { + fnClearAfterClose = function () { + this._oSelectedItem = this._oList.getSelectedItem(); + this._aSelectedItems = this._oList.getSelectedItems(); + + this._oDialog.detachAfterClose(fnClearAfterClose); + this._fireConfirmAndUpdateSelection(); + }.bind(this); + this._oDialog.attachAfterClose(fnClearAfterClose); + this._oDialog.close(); + } + }.bind(this) }); } return this._oClearButton; @@ -1098,7 +1111,7 @@ function( oInfoBar = this._oList.getInfoToolbar(); if (this.getShowClearButton() && this._oClearButton) { - this._oClearButton.setEnabled(iSelectedContexts > 0); + this._oClearButton.setEnabled(iSelectedContexts > 0 || !this.getMultiSelect()); } // update the selection label oInfoBar.setVisible(!!iSelectedContexts && this.getMultiSelect());