diff --git a/src/bundle/Resources/public/js/scripts/core/dropdown.js b/src/bundle/Resources/public/js/scripts/core/dropdown.js index 6585c4cfe4..3a2559c84b 100644 --- a/src/bundle/Resources/public/js/scripts/core/dropdown.js +++ b/src/bundle/Resources/public/js/scripts/core/dropdown.js @@ -65,6 +65,9 @@ this.container.classList.toggle('is-invalid', isInvalid); }); + this.resizeObserver = new ResizeObserver(() => { + this.fitItems(); + }); this.currentSelectedValue = this.sourceInput.value; this.createSelectedItem = this.createSelectedItem.bind(this); @@ -565,6 +568,7 @@ attributes: true, attributeFilter: ['class'], }); + this.resizeObserver.observe(this.container); const selectedItems = this.container.querySelectorAll( '.ibexa-dropdown__selected-item:not(.ibexa-dropdown__selected-overflow-number):not(.ibexa-dropdown__selected-placeholder)',