diff --git a/static/ui.js b/static/ui.js index db76d20f..953b3615 100644 --- a/static/ui.js +++ b/static/ui.js @@ -574,9 +574,10 @@ function _positionModelDropdown(){ const chip=$('composerModelChip'); const mobileAction=$('composerMobileModelAction'); const footer=document.querySelector('.composer-footer'); - if(!dd||!chip||!footer) return; + if(!dd||!footer) return; const panel=$('composerMobileConfigPanel'); - const anchor=(panel&&panel.classList.contains('open')&&mobileAction)?mobileAction:chip; + const anchor=(panel&&panel.classList.contains('open')&&mobileAction)?mobileAction:(chip&&chip.offsetParent?chip:mobileAction); + if(!anchor) return; const chipRect=anchor.getBoundingClientRect(); const footerRect=footer.getBoundingClientRect(); let left=chipRect.left-footerRect.left;