Skip to content

Commit

Permalink
Fix Searchbar dropdown-menu positioning (#2567)
Browse files Browse the repository at this point in the history
Fix initial dropdown-menu positioning by replacing d-none
with visibility:hidden. Popper.js cannot calculate the position of
elements removed from the DOM with display: none. Let's
replace d-none with visibility:hidden, keeping the element
in the DOM, allowing Popper.js to correctly calculate its position.
  • Loading branch information
gerteck authored Aug 11, 2024
1 parent bac8391 commit 70ba5e5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/vue-components/src/Searchbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ export default {
return [
'dropdown-menu',
'search-dropdown-menu',
{ show: this.showDropdown },
{ 'd-none': !this.showDropdown },
{ 'show': this.showDropdown },
{ 'dropdown-menu-hidden': !this.showDropdown },
{ 'dropdown-menu-end': this.menuAlignRight },
];
},
Expand Down Expand Up @@ -304,6 +304,10 @@ export default {
visibility: hidden;
overflow: hidden;
}
.dropdown-menu-hidden {
visibility: hidden;
}
</style>

<style>
Expand Down

0 comments on commit 70ba5e5

Please sign in to comment.