diff --git a/framework/core/js/src/forum/components/Search.js b/framework/core/js/src/forum/components/Search.js index 9698c58df..cc1083c03 100644 --- a/framework/core/js/src/forum/components/Search.js +++ b/framework/core/js/src/forum/components/Search.js @@ -113,6 +113,13 @@ export default class Search extends Component { onupdate() { // Highlight the item that is currently selected. this.setIndex(this.getCurrentNumericIndex()); + + // Since extensions might add elements above the search box on mobile, + // we need to calculate and set the max height dynamically. + const resultsElementMargin = 14; + const maxHeight = + window.innerHeight - this.element.querySelector('.Search-input>.FormControl').getBoundingClientRect().bottom - resultsElementMargin; + this.element.querySelector('.Search-results').style['max-height'] = `${maxHeight}px`; } oncreate(vnode) { diff --git a/framework/core/less/common/Search.less b/framework/core/less/common/Search.less index 8bb523bba..d43e863c8 100644 --- a/framework/core/less/common/Search.less +++ b/framework/core/less/common/Search.less @@ -15,7 +15,6 @@ } } .Search-results { - max-height: 70vh; overflow: auto; left: auto; right: 0;