From 1fd5c52c42f2e3f864d29f7d6bc2ae8b9fe5e8b3 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Sun, 1 Sep 2024 14:59:11 +0800 Subject: [PATCH] style: adjust the position of floating elements on the x-axis --- packages/core/src/Overlay.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/src/Overlay.vue b/packages/core/src/Overlay.vue index 8128dd8..069b480 100644 --- a/packages/core/src/Overlay.vue +++ b/packages/core/src/Overlay.vue @@ -66,6 +66,9 @@ export default { x = Math.max(margin, x) x = Math.min(x, window.innerWidth - floatsWidth - margin) + if (x < floatsWidth / 2) { + x = floatsWidth / 2 + margin + } y = Math.max(margin, y) y = Math.min(y, window.innerHeight - floatsHeight - margin)