fix: zoom-aware clamping in cookbook task/serve dropdown positioning
The initial positioning used zoom-divided rect coordinates but the visualViewport clamping block used raw rect.bottom/rect.top without dividing by zoom. At ui-scale-125 the clamp pushed dropdowns off-screen. Affected cookbook task menu-btn and serve-config dropdown menus.
This commit is contained in:
parent
596d5b7ed2
commit
6c9e04fa69
2 changed files with 4 additions and 4 deletions
|
|
@ -2544,9 +2544,9 @@ export function _renderRunningTab() {
|
|||
const viewBottom = vv ? vv.offsetTop + vv.height : window.innerHeight;
|
||||
const dh = dropdown.offsetHeight;
|
||||
const m = 8;
|
||||
let top = rect.bottom + 2;
|
||||
let top = rect.bottom / z + 2;
|
||||
if (top + dh > viewBottom - m) {
|
||||
const above = rect.top - 2 - dh;
|
||||
const above = rect.top / z - 2 - dh;
|
||||
top = above >= viewTop + m ? above : Math.max(viewTop + m, viewBottom - dh - m);
|
||||
}
|
||||
dropdown.style.top = top + 'px';
|
||||
|
|
|
|||
|
|
@ -1090,9 +1090,9 @@ function _rerenderCachedModels() {
|
|||
const viewBottom = vv ? vv.offsetTop + vv.height : window.innerHeight;
|
||||
const dh = dropdown.offsetHeight;
|
||||
const mm = 8;
|
||||
let top = rect.bottom + 2;
|
||||
let top = rect.bottom / z + 2;
|
||||
if (top + dh > viewBottom - mm) {
|
||||
const above = rect.top - 2 - dh;
|
||||
const above = rect.top / z - 2 - dh;
|
||||
top = above >= viewTop + mm ? above : Math.max(viewTop + mm, viewBottom - dh - mm);
|
||||
}
|
||||
dropdown.style.top = top + 'px';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue