diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 316b5e736..e39ef1961 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -300,14 +300,15 @@ class Dropdown extends BaseComponent { name: 'applyCustomStyles', enabled: true, phase: 'afterWrite', - fn: () => { + fn: ({ state }) => { this._menu.style.removeProperty('position') const initialPosition = getComputedStyle(this._menu).position if (this._config.display === 'static' || initialPosition === 'static') { - // this._menu.style.position = 'static' this._menu.style.removeProperty('margin') this._menu.style.removeProperty('transform') Manipulator.setDataAttribute(this._menu, 'popper', 'static') // todo:v6 remove? + } else { + this._menu.style.position = state.styles.popper.position } } }] diff --git a/js/tests/unit/dropdown.spec.js b/js/tests/unit/dropdown.spec.js index 56ac4ff49..ec87159d6 100644 --- a/js/tests/unit/dropdown.spec.js +++ b/js/tests/unit/dropdown.spec.js @@ -1071,7 +1071,7 @@ describe('Dropdown', () => { }) describe('update', () => { - it('should call Popper and detect navbar on update', () => { + it('should call Popper on update', () => { fixtureEl.innerHTML = [ '