Skip to content

Commit

Permalink
Fix Lookup component scrollbar height after open and closing menu (#682)
Browse files Browse the repository at this point in the history
Bug: T325822
  • Loading branch information
guergana committed Aug 14, 2023
1 parent c2ec0c2 commit 780a699
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vue-components/src/components/OptionsMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ export default defineComponent( {
const maxNumberOfElementsDisplayed = 6;
if ( menuItems && menuItems.length > maxNumberOfElementsDisplayed ) {
const menuHeight = menuItems[ maxNumberOfElementsDisplayed ].offsetTop - menuItems[ 0 ].offsetTop;
this.maxHeight = menuHeight;
// See: https://phabricator.wikimedia.org/T325822#9078296
if ( menuHeight > 0 ) {
this.maxHeight = menuHeight;
}
} else {
this.maxHeight = null;
}
Expand Down

0 comments on commit 780a699

Please sign in to comment.