From bb2ecfc87dc95e67aea7acfce92de296899db074 Mon Sep 17 00:00:00 2001 From: Nikoleta Ivanova <31706628+nikoletavnv@users.noreply.github.com> Date: Thu, 30 Nov 2023 15:39:49 +0200 Subject: [PATCH] fix(ui5-multi-combobox): adjust open property handling (#7763) --- packages/main/src/MultiComboBox.ts | 38 +++++++++++++++++++----------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/packages/main/src/MultiComboBox.ts b/packages/main/src/MultiComboBox.ts index fb74df8aff88..28ef083f2eb1 100644 --- a/packages/main/src/MultiComboBox.ts +++ b/packages/main/src/MultiComboBox.ts @@ -353,19 +353,6 @@ class MultiComboBox extends UI5Element { @property({ type: ComboBoxFilter, defaultValue: ComboBoxFilter.StartsWithPerTerm }) filter!: `${ComboBoxFilter}`; - /** - * Indicates whether the dropdown is open. True if the dropdown is open, false otherwise. - * - * @type {boolean} - * @name sap.ui.webc.main.MultiComboBox.prototype.open - * @defaultvalue false - * @readonly - * @since 1.0.0-rc.5 - * @public - */ - @property({ type: Boolean }) - open!: boolean; - /** * Defines the accessible ARIA name of the component. * @@ -390,6 +377,16 @@ class MultiComboBox extends UI5Element { @property() accessibleNameRef!: string; + /** + * Indicates whether the dropdown is open. True if the dropdown is open, false otherwise. + * + * @type {boolean} + * @defaultvalue false + * @private + */ + @property({ type: Boolean }) + _open!: boolean; + @property({ type: Object, noAttribute: true, multiple: true }) _filteredItems!: Array; @@ -545,6 +542,19 @@ class MultiComboBox extends UI5Element { this.selectedItems = this.items.filter((item, idx, allItems) => MultiComboBox._groupItemFilter(item, ++idx, allItems, selectedItems) || selectedItems.indexOf(item) !== -1); } + /** + * Indicates whether the dropdown is open. True if the dropdown is open, false otherwise. + * + * @type {boolean} + * @name sap.ui.webc.main.MultiComboBox.prototype.open + * @defaultvalue false + * @readonly + * @public + */ + get open() { + return this._open; + } + get _showAllItemsButtonPressed(): boolean { return this.filterSelected; } @@ -1251,7 +1261,7 @@ class MultiComboBox extends UI5Element { } _toggle() { - this.open = !this.open; + this._open = !this._open; this.fireEvent("open-change"); }