Fix leads filter popover anchoring under the button in RTL.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-19 08:58:27 +03:30
co-authored by Cursor
parent 12786d30d5
commit dbb61ff870
+9 -3
View File
@@ -301,12 +301,12 @@ function toggleFilterSection(name: NonNullable<typeof filterSection.value>) {
const filterAnchor = ref<HTMLElement | null>(null);
const filterPopoverMaxHeight = ref('min(70vh, 32rem)');
const filterPanelPos = ref({ top: 0, inlineEnd: 8 });
const filterPanelPos = ref({ top: 0, left: 8 });
const filterPanelStyle = computed(() => ({
position: 'fixed' as const,
top: `${filterPanelPos.value.top}px`,
insetInlineEnd: `${filterPanelPos.value.inlineEnd}px`,
left: `${filterPanelPos.value.left}px`,
zIndex: 1050,
width: 'min(20rem, calc(100vw - 1.5rem))',
maxHeight: filterPopoverMaxHeight.value,
@@ -323,9 +323,15 @@ function placeFilterPopover() {
const rect = el.getBoundingClientRect();
const space = Math.floor(window.innerHeight - rect.bottom - 12);
filterPopoverMaxHeight.value = `${Math.max(220, space)}px`;
// همان رفتار absolute با inset-inline-end:0 (RTL): لبهٔ چپ پنل = لبهٔ چپ دکمه
const panelW = Math.min(20 * 16, window.innerWidth - 24);
let left = rect.left;
if (left + panelW > window.innerWidth - 8) {
left = window.innerWidth - panelW - 8;
}
filterPanelPos.value = {
top: rect.bottom + 6,
inlineEnd: Math.max(8, Math.round(window.innerWidth - rect.right)),
left: Math.max(8, Math.round(left)),
};
}