fix(ui): model dropdown invisible on mobile — anchor fallback to mobile action when desktop chip hidden

This commit is contained in:
joaompfp
2026-05-02 17:30:01 +01:00
parent 22fce2fda1
commit eafda3cebc
+3 -2
View File
@@ -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;