From 630b1be7a6af91e7cfd0c6df59b5000a2b45f44e Mon Sep 17 00:00:00 2001 From: Lukasz Ostafin Date: Tue, 22 Sep 2026 14:38:23 +0200 Subject: [PATCH] IBX-12394: Kept the draggable dialog 10px away from the right edge of the viewport Co-Authored-By: Claude Fable 5.1 --- .../src/modules/common/draggable-dialog/draggable.dialog.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bundle/ui-dev/src/modules/common/draggable-dialog/draggable.dialog.js b/src/bundle/ui-dev/src/modules/common/draggable-dialog/draggable.dialog.js index 80923be603..58ae8a766e 100644 --- a/src/bundle/ui-dev/src/modules/common/draggable-dialog/draggable.dialog.js +++ b/src/bundle/ui-dev/src/modules/common/draggable-dialog/draggable.dialog.js @@ -6,6 +6,8 @@ import { createCssClassNames } from '@ibexa-admin-ui/src/bundle/ui-dev/src/modul export const DraggableContext = createContext(); +const OFFSET_FROM_RIGHT_EDGE = 16; + const DraggableDialog = ({ children = null, referenceElement, positionOffset = () => ({ x: 0, y: 0 }) }) => { const rootDOMElement = getRootDOMElement(); const containerRef = useRef(); @@ -116,8 +118,8 @@ const DraggableDialog = ({ children = null, referenceElement, positionOffset = ( if (x < 0) { x = 0; - } else if (x + containerWidth > window.innerWidth) { - x = window.innerWidth - containerWidth; + } else if (x + containerWidth > window.innerWidth - OFFSET_FROM_RIGHT_EDGE) { + x = window.innerWidth - containerWidth - OFFSET_FROM_RIGHT_EDGE; } if (y < 0) {